From a8978c6a3a4de8f49055e77e09b453fb4ea55420 Mon Sep 17 00:00:00 2001 From: David Turner Date: Thu, 25 May 2023 16:14:59 +0100 Subject: [PATCH] Fix docs for transport_worker hot threads (#96346) Backports the docs changes from #96315, reflecting the change introduced in #90482, but adjusting them slightly to reflect the different behaviour in earlier versions. Co-authored-by: Elastic Machine --- docs/reference/modules/network/threading.asciidoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/reference/modules/network/threading.asciidoc b/docs/reference/modules/network/threading.asciidoc index 2e26ae89dbdea..c492f0eb340db 100644 --- a/docs/reference/modules/network/threading.asciidoc +++ b/docs/reference/modules/network/threading.asciidoc @@ -63,7 +63,7 @@ reported like this: [source,text] ---- - 100.0% [cpu=0.0%, other=100.0%] (500ms out of 500ms) cpu usage by thread 'elasticsearch[instance-0000000004][transport_worker][T#1]' + 0.0% [cpu=0.0%, idle=100.0%] (500ms out of 500ms) cpu usage by thread 'elasticsearch[instance-0000000004][transport_worker][T#1]' 10/10 snapshots sharing following 9 elements java.base@17.0.2/sun.nio.ch.EPoll.wait(Native Method) java.base@17.0.2/sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:118) @@ -78,10 +78,10 @@ reported like this: Note that `transport_worker` threads should always be in state `RUNNABLE`, even when waiting for input, because they block in the native `EPoll#wait` method. -This means the hot threads API will report these threads at 100% overall -utilisation. This is normal, and the breakdown of time into `cpu=` and `other=` -fractions shows how much time the thread spent running and waiting for input -respectively. +The `idle=` time reports the proportion of time the thread spent waiting for +input, whereas the `cpu=` time reports the proportion of time the thread spent +processing input it has received. If the thread was seen using absolutely no +CPU then it will report `0.0% [cpu=0.0%, idle=0.0%]`. If a `transport_worker` thread is not frequently idle, it may build up a backlog of work. This can cause delays in processing messages on the channels