lurcher / unixODBC

The unixODBC Project goals are to develop and promote unixODBC to be the definitive standard for ODBC on non MS Windows platforms.
GNU Lesser General Public License v2.1
100 stars 52 forks source link

Does MaxPoolSize limit the total number of connections that can be opened simultaneously? #154

Closed mohsen-eng74 closed 9 months ago

mohsen-eng74 commented 9 months ago

Hello, Does MaxPoolSize limit the total number of connections that can be opened simultaneously? I've configured the /etc/odbcinst.ini as follows, But whenever I create connections simultaneously (using asyncio or multithreading) the total number of opened connections (checked via lsof -ai -p "PID") goes over the limit I've set for MaxPoolSize to the created number of threads or tasks.

[ODBC]
Pooling=1
UsageCount=2
MaxPoolSize=100
PoolWaitTimeout=30

[ODBC Driver 18 for SQL Server]
Description=Microsoft ODBC Driver 18 for SQL Server
Driver=/opt/microsoft/msodbcsql18/lib64/libmsodbcsql-18.3.so.2.1
UsageCount=2
CPTimeout=120

Environment:

Best Regards, Mohsen

lurcher commented 9 months ago

On 16/12/2023 14:34, Mohsen Rahmati wrote:

Hello, Does |MaxPoolSize| limit the total connection that can be opened simultaneously? I've configured the |/etc/odbcinst.ini| as follows, But whenever I create a connection simultaneously (using asyncio or multithreading) the total number of opened connections (checked via |lsof -ai -p "PID"|) goes over the limit I've set for |MaxPoolSize| to the created number of threads or tasks.

No, it limits the number of connections that can be held in the pool waiting to be reused.

mohsen-eng74 commented 9 months ago

On 16/12/2023 14:34, Mohsen Rahmati wrote: Hello, Does |MaxPoolSize| limit the total connection that can be opened simultaneously? I've configured the |/etc/odbcinst.ini| as follows, But whenever I create a connection simultaneously (using asyncio or multithreading) the total number of opened connections (checked via |lsof -ai -p "PID"|) goes over the limit I've set for |MaxPoolSize| to the created number of threads or tasks. No, it limits the number of connections that can be held in the pool waiting to be reused.

Thanks. Then, would you guide what the PoolWaitTimeout parameter does? If I understood correctly, the CPTimeout parameter sets the maximum age of an idle connection in the pool, and if MaxPoolSize does not limit the total number of connections, then I don't know what PoolWaitTimeout configures.

lurcher commented 9 months ago

On 18/12/2023 03:25, Mohsen Rahmati wrote:

On 16/12/2023 14:34, Mohsen Rahmati wrote: Hello, Does
|MaxPoolSize| limit the total connection that can be opened
simultaneously? I've configured the |/etc/odbcinst.ini| as
follows, But whenever I create a connection simultaneously (using
asyncio or multithreading) the total number of opened connections
(checked via |lsof -ai -p "PID"|) goes over the limit I've set for
|MaxPoolSize| to the created number of threads or tasks.
No, it limits the number of connections that can be held in the
pool waiting to be reused.

Thanks. Then, would you guide what the |Pool Wait_Timeout| parameter does?

The number of seconds a connection is left waiting in the pool list when inactive (not attached to an application).