Daniel,
On 11/28/23 15:23, Daniel Andres Pelaez Lopez wrote:
Hi community,
We have a heavy workload where the client uses a lot of keep-alive
connections, and we want to measure how many keep-alive connections
are open, but we cannot find metrics (MBean) with that information.
The closest one is tomcat_connections_keepalive_current but it seems
weird the data doesn't match, and tomcat_connections_current counts
everything.
From this old post
(https://users.tomcat.apache.narkive.com/LbyzmDXn/how-to-get-the-number-of-keep-alive-connections),
it seems hard to measure it, so, do we have any other metrics that can
help? like tomcat_connections_closed or similar? maybe by knowing the
closed ones vs open ones, we can figure out the keep-alive ones.
Any insight will be appreciated.
What kind of number are you looking for?
The total number of connections should increase by 1 every time a new
connection is established -- that seems obvious.
Can you please give the JMX path to tomcat_connections_keepalive_current
and tomcat_connections_current? I have no idea what you are talking
about there... is there some tool that provides those "variable names"
to you somewhere?
This other number... should that be the total number of requests ever
requested? I think that already exists
(GloablRequestProcessor/[connector]/requestCount or
WebModule/[app]/none/none/requestCount).
So the average number of keep-alives-per-connection would just be the
ratio of those two. But it sounds like you'd like to get the
current-number of keep-alive requests for any active connection at any
time. Is that what you are asking?
"Give me the maximum number of keep-alive requests for any current
connections?"
Answer: a single integer
"Give me the average number of keep-alive requests for all current
connections?"
Answer: a single integer
"Give me all the keep-alives for currently-active connections?"
Answer: a list of up to 10,000 integers (by default, can be increased
via configuration)
By definition, any connection that is open and not currently-processing
a request is in the "keep-alive" state. Is that what you want to count?
The Manager application has a view of all current connections which
shows their state, including "waiting for next keep-alive request".
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org