Feature #60029
Tune Tomcat config to reduce CLOSE_WAIT sockets
100%
Description
from https://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Stuck_Thread_Detection_Valve
tuck Thread Detection Valve
Introduction
This valve allows to detect requests that take a long time to process, which might indicate that the thread that is processing it is stuck. Additionally it can optionally interrupt such threads to try and unblock them.
When such a request is detected, the current stack trace of its thread is written to Tomcat log with a WARN level.
The IDs and names of the stuck threads are available through JMX in the stuckThreadIds and stuckThreadNames attributes. The IDs can be used with the standard Threading JVM MBean (java.lang:type=Threading) to retrieve other information about each stuck thread.
Attributes
The Stuck Thread Detection Valve supports the following configuration attributes:
Attribute Description
className
Java class name of the implementation to use. This MUST be set to org.apache.catalina.valves.StuckThreadDetectionValve.
threshold
Minimum duration in seconds after which a thread is considered stuck. Default is 600 seconds. If set to 0, the detection is disabled.
Note: since the detection (and optional interruption) is done in the background thread of the Container (Engine, Host or Context) declaring this Valve, the threshold should be higher than the backgroundProcessorDelay of this Container.
interruptThreadThreshold
Minimum duration in seconds after which a stuck thread should be interrupted to attempt to "free" it.
Note that there's no guarantee that the thread will get unstuck. This usually works well for threads stuck on I/O or locks, but is probably useless in case of infinite loops.
Default is -1 which disables the feature. To enable it, the value must be greater or equal to threshold.
History
Updated by Alex I over 4 years ago
- Subject changed from enable StuckThreadDetectionValve with 40 min timeout it will force close leeked connections (leads to less CLOSE_WAIT connections) to Tune Tomcat config to recuce CLOSE_WAIT sockets
- Operation System set to --
Updated by Alex I over 4 years ago
- Subject changed from Tune Tomcat config to recuce CLOSE_WAIT sockets to Tune Tomcat config to reduce CLOSE_WAIT sockets