I get the error com.mongodb.MongoWaitQueueFullException: Too many threads are already waiting for a connection. Max number of threads (maxWaitQueueSize) of 500 has been exceeded.
while doing a stress test on my application.
So I am thinking of configuring the maxWaitQueueSize
property via configuration.
I am using spring boot to configure mongodb connection. I am using @EnableAutoConfiguration in my Application and I have declared only spring.data.mongodb.uri=mongodb://user:password@ip:27017
in the application.properties file.
How do I configure the maxWaitQueueSize
property with spring boot?
How do I decide a good value for the maxWaitQueueSize
?
Copyright Notice:Content Author:「ravindrab」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/35412696/configure-mongodb-property-maxwaitqueuesize-in-spring-boot-application