What is connection limit meant for?

what is the connection limit meant for?
does it mean that i can have certain number of connections at a given period or during a 24 hrs period?
if it is for given period, what is the time period for that
does having a free cluster mean that i have a limited number of queries and connections .

2 Likes

Hi @Sajal_Poudel,

Welcome to the community!

what is the connection limit meant for?
does it mean that i can have certain number of connections at a given period or during a 24 hrs period?

The connection limit in Atlas represents the maximum number of simultaneous connections that the mongos or mongod will accept.

does having a free cluster mean that i have a limited number of queries and connections

As per the Free & Shared Tier limitations documentation, M0 free clusters and M2/M5 shared clusters are allowed a maximum of 500 connections. The documentation also mentions other limitations that may be useful for you to be aware of. Please also note, the connection limit is per node for each cluster. Additionally, you may find the connection limits per cluster tier & class as documented here helpful.

Hope this answers your questions.

Regards,
Jason

2 Likes

So does that mean that at any given time there can be only max 500 people accessing the database, and there is nothing like max 500 people per day, right?

Hi @Tom_Shaw,

The connection limit is for concurrent database connections which are typically not 1:1 with your end users. End users connect to your application server, and your application server then connects to your Atlas cluster to process data queries & updates.

Most MongoDB drivers use connection pools to manage database requests so connections do not overwhelm server resources and established connections can be reused (saving some overhead of negotiating and establishing a new connection). Tuned database operations should execute very quickly: by default any operation executing for 100 milliseconds or more is considered a slow operation.

Each active database connection has some server overhead, so the maximum number of connections on Atlas scales based on cluster size.

Similarly, most web and application servers have connection limits to ensure requests are either queued or rejected as appropriate to maintain overall application performance. Without limits you will eventually run into performance issues because of resource contention (for example, heavy swapping from RAM to disk).

Regards,
Stennie

1 Like