Automatic thread dumps from JBoss EAP
Environment
- JBoss Enterprise Application Platform (EAP)
- 7.x
- 8.x
Issue
- Is there any feature for automatic thread dumps from JBoss EAP if it becomes slow, unresponsive or experiences thread exhaustion?
Resolution
- There's not a full automatic thread dump feature at the JBoss or JVM level but there are some similar options to consider
- One option would be enabling the Undertow stuck thread handler for a logged stack trace of an individual request thread any time it exceeds a desired threshold. That provides an indication of each slow occurrence individually and if those collectively accumulate over time to contribute to request thread exhaustion.
- Another option could be something external to JBoss attempting a simple health check request and performing thread dumps if such a health check fails or reaches a set timeout. Some local scripting with a simple curl request and jstack capturing thread dumps could accomplish that.
hang_collector.shis attached to this as an example that could be used towards that. Note this is not any supported code or feature but just an example to start with and build on and use and self-support as desired for this purpose. Such an example would be launched like below with the given local url to use for simple healthchecks and theJBOSS_PIDto capture thread dumps from (also update theJAVA_HOMEin the script):
./hang_collector.sh http://ip:8080/testurl $JBOSS_PID
SBR
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.