Maximum (client request) thread pool size in spring

ghz 1years ago ⋅ 6873 views

Question

I am developing application server using spring boot app but now I want to know what is the default maximum (client request) thread pool size in spring and how can I customize that value?


Answer

Assuming that you're using embedded Tomcat, Spring Boot provides a property to control the size of the client request thread pool. Its default value is zero which leaves Tomcat to use its default of 200. If you're using Spring Boot 2.3 or later, this property is named [server.tomcat.threads.max](https://docs.spring.io/spring- boot/docs/2.7.x/reference/html/application-properties.html#application- properties.server.server.tomcat.threads.max). In earlier versions of Spring Boot, the property is named [server.tomcat.max- threads](https://docs.spring.io/spring- boot/docs/2.2.x/reference/html/appendix-application-properties.html#common- application-properties-server).

To customise the size of this thread pool you should specify a non-zero value for the property in your application.properties or application.yml file.