JIRA Crashes After Exceeding Maximum Number of Threads
Symptoms
JIRA displays the following error in the application server logs and crashes:
Jun 12, 2012 12:38:04 PM org.apache.tomcat.util.net.JIoEndpoint createWorkerThread
INFO: Maximum number of threads (150) created for connector with address null and port 8080
Jun 12, 2012 12:41:31 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Jun 12, 2012 12:41:32 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Cause
JIRA is crashing due to Tomcat reaching the maximum number of threads configured for the Connector. When it tries to create a new one, the application stops responding and starts to shutdown the application server. This might be caused due to two main reasons:
- The JIRA server is not able to handle the current server load with the number of threads currently configured.
- There is a retention in the application threads, causing new threads to be created and also preventing existing threads to complete their execution.
Resolution
For Cause 1:
Increasing the maxThreads parameter for the Tomcat Connector affected should resolve the issue.
Open the server.xml located at JIRA-INSTALL/conf and modify the parameter inside the connector. In the error above, we could see the problem happened on the connector listening on port 8080 (http-8080):
<Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" port="8080" protocol="HTTP/1.1" redirectPort="8443" useBodyEncodingForURI="true"/>
Modify just the maxThreads that you see above at 150 to 200:
<Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxSpareThreads="75" maxThreads="200" minSpareThreads="25" port="8080" protocol="HTTP/1.1" redirectPort="8443" useBodyEncodingForURI="true"/>
Restart JIRA.
For Cause 2:
Before Tomcat shuts down, the number of available threads should cause the JIRA performance to degrade.
Once these symptoms are noticed, generate a set of thread dumps following the instructions in the Troubleshooting Jira performance with Thread dumps document and report a Support Ticket with the thread dumps attached.