AuraDB instances run with a set defined maximum of connections.
This is done to contain the memory usage (and protect the AuraDB Instance) dedicated to implementing the network resources (threads) necessary to handle these individual connections.
dbms.connector.bolt.thread_pool_max_size=400
Should you have some application in an environment or framework designed for scaling you should consider that value carefully.
More importantly, when it comes to implementation it is better to run more "driver sessions" rather than have multiple instances of the driver object.
But if you need to have multiple drivers for architectural/technical reasons then you will need to reduce the default connection pool setting for each driver configuration so as to avoid overwhelming your AuraDB instance.
Example:
Having a scale factor of 16, and 400 connections to share you should at most use 400 / 16 = 25
driver = GraphDatabase.driver(
uri,
AuthTokens.basic(username, password),
Config.builder()
.withMaxConnectionPoolSize(25)
.withConnectionLivenessCheckTimeout(2, TimeUnit.MINUTES).build())
Comments
0 comments
Article is closed for comments.