When the number of connections to your Aura (AuraDB and AuraDS) Instance exceeds a certain level, you might see the below error:
Neo4jError: There are no available threads to serve this request at the moment.
You can retry at a later time or consider increasing max thread pool size for bolt
connector(s).
We recommend getting yourself familiar with thread pool size.
As there could be a high number of idle connections, you should set withMaxConnectionPoolSize
to an optimal number in the driver objects.
The default setting for maxConnectionPoolSize is 200.
If you are connecting from just one driver instance, the default value would be fine.
But If you have multiple instances of your application or if you are initializing multiple driver instances within the same application, the default maxConnectionPoolSize value of 200 could quickly multiply and overwhelm your Aura instance.
The suggested setting for withMaxConnectionPoolSize
is 20, and it can be tuned the value based on the setup and load on the Aura Instance.
Config config = Config.builder()
.withMaxConnectionLifetime( 30, TimeUnit.MINUTES )
.withMaxConnectionPoolSize( 20 )
.withConnectionAcquisitionTimeout( 2, TimeUnit.MINUTES )
.build(); Driver driver = GraphDatabase.driver( uri, AuthTokens.basic( user, password ),
config );
Comments
0 comments
Article is closed for comments.