Closed
Description
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.
Metadata
Metadata
Assignees
Labels
No labels