MaxConnectionPoolSize is not respected under heavy load
See original GitHub issueThe default internal connection pool size for this driver seems to be set at 100. I’m seeing that this can be broken. Basic test to reproduce this behavior:
test('Connection pool', async () => {
const driver = Neo4J.driver('bolt://localhost:7687', Neo4J.auth.basic('neo4j', 'neo4j'), {
disableLosslessIntegers: true,
});
const p: Promise<any>[] = [];
for (let i = 0; i < 1500; i++) {
p.push(new Promise(async (res, rej) => {
const session = driver.session();
await session.run('MATCH (n) RETURN n');
session.close();
res();
}));
}
await Promise.all(p);
}, 30000);
Watch netstat while you run this test and see that the number of connections goes into the thousands:
watch -n .5 'netstat -an | grep "7687" | grep ESTABLISHED | wc -l'
I’ve tested this against Neo4j 3.5.3 and 3.5.12 using driver versions 1.7.5 and 4.0.0-beta01.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Periodic MySql timeout followed by connection spike in ASP ...
The timeouts do not seem to correspond with heavy database load. The CPU is often under 7% when this happens spiking up to...
Read more >Client applications - Neo4j Go Driver Manual
Negative values result in lifetime not being checked. Default: 1 hour (3600 seconds). MaxConnectionPoolSize. The maximum total number of connections allowed, ...
Read more >Tuning Connection Pool Properties In WebSphere Application ...
If the Maximum connections value is high like 100, doubling the Webcontainer thread pool size may not be practical. In that case, it...
Read more >Azure Cosmos DB best practices for Java SDK v4
Regions, Make sure to run your application in the same Azure ... help with bottlenecks due to high traffic and reduce latency or...
Read more >Manage Red Hat Quay
Setting up Clair on a non-OpenShift Red Hat Quay deployment; 7.3. ... When under heavy load, it is possible to fill the connection...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @aaronjwood, The change was also merged in 1.7. But I currently do not have a patch release date for next 1.7. I will let you know once I got more information.
Hi @aaronjwood , Thanks very much for reporting this to us. We are releasing a new 4.0.0-rc1 driver with the fix inside. The fix ensures the maximum active connection count is always less or equal to
MaxConnectionPoolSize
.