netmon80
netmon80

Reputation: 11

Resquest time included STW (Garbage Collection) time in Java (Tomcat)

Are there any request time metric in catalina jmx, that account Garbage Collection time (if apply)?

I know the metrics for GC time but i am searching for something that reflects the request time end to end inside JVM.

Thanks a lot.

JMX metric for request time end to end inside JVM.

Upvotes: 0

Views: 55

Answers (1)

netmon80
netmon80

Reputation: 11

In https://tomcat.apache.org/tomcat-8.5-doc/config/http.html I read:

"Connections are queued inside the server socket created by the Connector until a thread becomes available to process the connection. Once maxConnections has been reached the operating system will queue further connections. The size of the operating system provided connection queue may be controlled by the acceptCount attribute. If the operating system queue fills, further connection requests may be refused or may time out."

And:

"acceptCount The maximum length of the operating system provided queue for incoming connection requests when maxConnections has been reached. The operating system may ignore this setting and use a different size for the queue. When this queue is full, the operating system may actively refuse additional connections or those connections may time out. The default value is 100."

So the queue pool is "outside" JVM and there isn't any JMX metric for it, therefore request time metric that include stop-the-world time is not posible.

What whe can do is to monitor queue pool from the operating system with next command:

ss -lt sport 10432
State      Recv-Q     Send-Q         Local Address:Port          Peer Address:Port     Process
LISTEN     0          100                        *:10432                    *:*

In above example, Tomcat is listening in port 10432. Have a 100 queue connection pool limit and 0 connections in queue. Recv-Q and Send-Q reflects connections in queue pool and Max connections in queue pool respectively when the command is issue in a Listen state port.

I did Next command:

while true ;do
ss -lt sport 10432
done

And queue pool increase when full Garbage Collection take place so it's very important to put an eye in Garbage Collection spent time metric.

Thanks.

Upvotes: 1

Related Questions