Maximum number of simultaneous database connections

Asked

Viewed 6,769 times

8

I am using a system monitoring solution and observe that at peak times the system has about 1500 simultaneous connections. From this data, I searched and could not find where I can check the limit of simultaneous connections with the database.

So, how do I set/check the connection limit with the database? Is the management of the connection pool the responsibility of the database or the application? Otherwise, what can interfere with the limit of this value?

  • 3

    Mysql or SQL Server?

  • 1

    Rodrigo, the application uses both databases, but what is reaching 1500 is SQL Server

  • 1

    Vinicius what I will say is not the answer, but assuming it is a web application, it is likely that in a request you make several connections without need, it is only a theory. Maybe analyzing the code could decrease by half (of course I don’t know the project so I might be talking nonsense).

1 answer

3


The limit of simultaneous connections may depend on:

  • version of your bank;
  • of the configured limit;
  • of hardware capacity;

So, how can I set/check the connection limit with the database?

The maximum limit for SQL Server is 32,767 connections. You can check the limit set on sys.Configurations. Remembering that the connection limit in SQL Server is by instance and not by database.

Connection pool management is the responsibility of the database or application?

The connection pool feature is managed by the application. There are different ORM frameworks that have their own implementation for connection pool management (ADO.NET, Hibernate, etc) or manage to connect to other connection pool management libraries (c3p0, Bonecp, etc).

If the application opens indefinitely connections with the database, without reusing or closing the ones it has already opened, there will come a time when the database will reach the set limit or, the most common, will gradually slow down the database. Opening a connection to the database is not a cheap resource.

Otherwise, what can interfere with the limit of this value?

The most common is that the database is slow long before reaching the maximum number of configured connections, usually by indiscriminate opening of connections, as explained above.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.