-
Notifications
You must be signed in to change notification settings - Fork 203
Connection Storm Prevention with Jitter in Connection Pool #1495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
are you using a single shared pool or multiple connection pools ? |
Multiple Connection pools; We are using multiple clients, each with its own connection pool. |
have you tried using a single shared pool ? |
I would say even with 1 pool with N times pool size (N = num verticles), the issue would still remain. |
It is not much of a problem if the connections are not used often due to less load, and there is randomness in when they are created, but if there is substantial load connections are almost always in use, then their lifecycles become synced. Due to the nature of how AWS reader endpoints work (DNS load balancing), it poses an issue if all connections are created around the same time. Unless there is a DB Proxy in front of the DB, the connection skew issue will persist. |
I see, thanks for your explanations, looking forward to review the pull request |
Problem
When running multiple instances of an application that uses PgPool, we observed a connection storm issue that leads to uneven load distribution across database readers.
Scenario
Current Behavior
When multiple application instances start simultaneously:
Example from Load Test
In our load test with 10 instances (8 verticles each):
Attaching a screenshot of connections made on readers. One of the readers has 227 connections, and the other has 72.
Proposed Solution
Introduce connection jitter to randomize connection timing:
jitter
parameter to PoolOptionsmaxLifetime
, apply random jitter within the specified rangeImplementation
Contribution
#1496
The text was updated successfully, but these errors were encountered: