Score:0

Should the maximum number of request threads be similar to the maximum number of database connections?

ua flag

I have a spring boot application with an embedded tomcat server. The max-threads setting of tomcat is currently set to 250. Next to that the spring boot application also uses a MySql database as the datasource. For managing DB connections its using the Hikari connection pool that is set to a maximum of 10 database connections.

The maximum amount of concurrent request threads and the maximum amount of concurrent database connections differ a lot. My question is: Should I lower the max-threads setting to 10 so that each request will always have a database connection available?

I would also like to know what happens when all 10 request threads are taken and an 11th request comes in, will that request get bounced? If that is the case then maybe i should keep the max-threads setting a bit higher then 10.

Thanks

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.