Hello Team,
I am experiencing an issue with my TimescaleDB setup while trying to store time-series data. When my application attempts to write rows to the database, it intermittently fails with the following error:
Npgsql.PostgresException (0x80004005): 53300: sorry, too many clients already
at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.ConnectorPool.OpenNewConnector(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.ConnectorPool.g__RentAsync|28_0(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnection.g__OpenAsync|45_0(Boolean async, CancellationToken cancellationToken)
Environment:
TimescaleDB version: 2.11.2
TimescaleDB version: 15.7
max_connections : 100
The application uses a connection pool provided by Npgsql.
Connection pooling is enabled with default settings.
Observations:
I checked the pg_stat_activity table and found only three active connections at the time of the error.
This suggests the error might not directly result from reaching the max_connections limit.
I am considering whether this could be related to issues with the connection pool or shared buffers.
Questions:
Could this error be caused by mismanagement of the connection pool or shared buffer settings in PostgreSQL?
Are there any metrics or diagnostic queries I can run to confirm whether shared buffers or connection pool exhaustion is contributing to the problem?
Any guidance or recommendations would be greatly appreciated!
Thank you in advance for your help.