agroal / pgagroal

High-performance connection pool for PostgreSQL
https://agroal.github.io/pgagroal/
BSD 3-Clause "New" or "Revised" License
667 stars 59 forks source link

pgagroal connections are in Graceful state since a long time #451

Open sheshjee opened 1 month ago

sheshjee commented 1 month ago

[postgres@dbm ~]$ pgagroal-cli status Status: Running Active connections: 876 Total connections: 883 Max connections: 1000 [postgres@dbm ~]$ pgagroal-cli details Status: Running Active connections: 876 Total connections: 883 Max connections: 1000

Server: primary Host: localhost Port: 5432 State: Primary

Connection 0: Graceful 2024-03-05 17:47:30 939245 12 mydb postgres Connection 1: Active 2024-05-21 14:30:05 987972 974 mydb postgres Connection 2: Graceful 2024-03-05 21:20:41 2123523 14 mydb postgres Connection 3: Graceful 2024-03-05 17:19:23 776934 13 mydb postgres Connection 4: Graceful 2024-03-05 18:41:07 1260190 18 mydb postgres Connection 5: Graceful 2024-03-05 16:58:24 663693 15 mydb postgres Connection 6: Graceful 2024-03-06 15:05:27 2609519 16 mydb postgres Connection 7: Graceful 2024-03-06 11:20:41 1769345 17 mydb postgres Connection 8: Graceful 2024-03-05 19:36:38 1562277 19 mydb postgres Connection 9: Graceful 2024-03-06 11:36:44 1797066 20 mydb postgres Connection 10: Graceful 2024-03-05 20:36:51 1873176 21 mydb postgres Connection 11: Graceful 2024-03-06 11:36:43 1796850 22 mydb postgres Connection 12: Graceful 2024-03-06 12:08:50 1952867 23 mydb postgres Connection 13: Graceful 2024-03-06 17:38:13 2899712 24 mydb postgres Connection 14: Graceful 2024-03-06 17:38:13 2899647 25 mydb postgres Connection 15: Graceful 2024-03-06 11:57:51 1890399 33 mydb postgres Connection 16: Graceful 2024-03-06 17:36:32 2895999 26 mydb postgres Connection 17: Graceful 2024-03-06 12:08:50 1952866 27 mydb postgres Connection 18: Graceful 2024-03-09 08:53:07 3416234 28 mydb postgres Connection 19: Graceful 2024-03-06 11:57:51 1890398 29 mydb postgres Connection 20: Graceful 2024-03-06 17:38:13 2899711 31 mydb postgres

Please suggest me why connections are in graceful state since a long time and is there any specific parameter in pgagroal.conf to free these connections??

fluca1978 commented 1 month ago

Seems pgagroal is not able to terminate the connections. Have you tried to run pgagroal-cli flush gracefully? Which version are you running?

sheshjee commented 1 month ago

Yes I tried and it removed the connections. But the issue is why connections are not being closed by itself.

pgagroal - 1.5

On Mon, May 27, 2024, 3:19 PM Luca Ferrari @.***> wrote:

Seems pgagroal is not able to terminate the connections. Have you tried to run pgagroal-cli flush gracefully? Which version are you running?

— Reply to this email directly, view it on GitHub https://github.com/agroal/pgagroal/issues/451#issuecomment-2133099958, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFMCG6ZM7IE2CPMVE4XUIVLZEL6RBAVCNFSM6AAAAABIKTHUBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZTGA4TSOJVHA . You are receiving this because you authored the thread.Message ID: @.***>

fluca1978 commented 1 month ago

It's hard to tell why gracefully connections are not closed in your case. And as already stated, version 1.5 is behind the current release, so while I'm not sure this could fix the problem, upgrading could make easier to debug. Moreover, understanding what PostgreSQL sees as connections could help. My suspect is that you have something preventing connections to be automatically closed, could it be an application?

sheshjee commented 1 month ago

Yes I think the same as client sends request by an application code to my Database.

On Mon, May 27, 2024, 6:21 PM Luca Ferrari @.***> wrote:

It's hard to tell why gracefully connections are not closed in your case. And as already stated, version 1.5 is behind the current release, so while I'm not sure this could fix the problem, upgrading could make easier to debug. Moreover, understanding what PostgreSQL sees as connections could help. My suspect is that you have something preventing connections to be automatically closed, could it be an application?

— Reply to this email directly, view it on GitHub https://github.com/agroal/pgagroal/issues/451#issuecomment-2133419527, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFMCG67V4VNHQYKMAGZ2XLLZEMT4PAVCNFSM6AAAAABIKTHUBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZTGQYTSNJSG4 . You are receiving this because you authored the thread.Message ID: @.***>