-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QueuedThreadPool "free" threads #5994
Comments
OTOH, it's good to know how many threads are actually used, internally, by Jetty. |
I think the Other metrics to consider making available:
|
After initial discussion, we may expose the thread budget component, so that we will know how many threads are used internally by Jetty, but also we could use it to know how many are "stolen" and should not be accounted for. |
@sbordet
So we have some invariants and derived stats:
|
Updates after review. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Fixes #5994 - QueuedThreadPool "free" threads
Jetty version
9.4.x
Description
On large machines, the heuristics we have for number of acceptors, selectors, and reserved threads may "steal" a lot of threads from the thread pool, so that a metric such as
(threads - idleThreads)/maxThreads
may show large percentages even for a completely idle server.For example, for a 112 cores machine we have
for a total of 172 "stolen" threads.
With
maxThreads=1024
or similar, that is a 17% "utilization" even if the server is idle.Using
busyThreads
instead of(threads - idleThreads)
takes into account reserved threads, so that figure would be only 60 "stolen" threads for a 6% "utilization".I wonder if we should at exclude acceptors and selectors from the count (i.e. rather than taking them from the pool, allocate the threads outside the pool -- however this would make the thread budget component irrelevant now).
Excluding them would help people to answer the question: "should I increase
maxThreads
or I'm good?".Users that monitor
busyThreads/maxThreads
will know on a 0-100% scale rather than always having a 6-17% "noise" even when the server is idle.@gregw @joakime @lorban thoughts?
The text was updated successfully, but these errors were encountered: