I have a Grails application which is deployed in Apache Tomcat server. Everything works fine but sometimes the application receives around 100-200 requests in succession(Due to an API integration and these many requests are sent by the API to my application that too within a few minutes and not by my application to the API) and tomcat starts to hang(There are no errors though).
The request is mostly to perform some small DB updates from the data sent by the API used.
Is there a way i can handle this? Any jvm setting or any code changes to handle this?
you need to increase the max threads in your tomcat server
<Connector port="8080" address="localhost"
maxThreads="250" <!-- here -->
maxHttpHeaderSize="8192"
emptySessionPath="true" protocol="HTTP/1.1"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />