-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Slightly better hot threads for transport workers #96315
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
Slightly better hot threads for transport workers #96315
Conversation
A completely idle `transport_worker` thread is reported as `0.0%` idle, which is confusing. Moreover the docs on the network threading model do not reflect the changes made in elastic#90482. This commit fixes both of those things.
|
Documentation preview: |
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
|
The docs in 8.6/8.7/8.8 are similarly outdated; I'll open a PR to fix them up too once this is merged. |
| double percentCpu = getTimeSharePercentage(topThread.getCpuTime()); | ||
| double percentOther = getTimeSharePercentage(topThread.getOtherTime()); | ||
| double percentOther = Transports.isTransportThread(threadName) && topThread.getCpuTime() == 0L | ||
| ? 100.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be 100 - topThread.getCpuTime? Like, is all the stuff no in cpuTime idle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm kinda, but (a) the cpu time is zero on this branch so subtracting it makes no difference, and (b) if we made this change on the nonzero-cpu-time branch then we would lose the ability to spot cases where the thread was actually not RUNNABLE for some time (e.g. waiting on a mutex, which is not what we consider to be "idle" here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! I see. There's other stuff not in getCpuTime. Makes sense.
Backports the docs changes from elastic#96315, reflecting the change introduced in elastic#90482, but adjusting them slightly to reflect the different behaviour in earlier versions.
Backports the docs changes from elastic#96315, reflecting the change introduced in elastic#90482, but adjusting them slightly to reflect the different behaviour in earlier versions. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Backports the docs changes from elastic#96315, reflecting the change introduced in elastic#90482, but adjusting them slightly to reflect the different behaviour in earlier versions. Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
A completely idle
transport_workerthread is reported as0.0%idle, which is confusing. Moreover the docs on the network threading model do not reflect the changes made in #90482. This commit fixes both of those things.