question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MaxConnectionPoolSize is not respected under heavy load

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
zhenlineocommented, Dec 1, 2019

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.

1reaction
zhenlineocommented, Nov 25, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found