node_exporter icon indicating copy to clipboard operation
node_exporter copied to clipboard

cpu iowait jitter

Open jhaohai opened this issue 7 years ago • 5 comments

Host operating system: output of uname -a

3.10.0-862.11.6.el7.x86_64

node_exporter version: output of node_exporter --version

0.15.2

node_exporter command line flags

/usr/sbin/node_exporter

Are you running node_exporter in Docker?

NO

What did you do that produced an error?

Nothing

What did you expect to see?

node_cpu is a counter. The value show always go up

What did you see instead?

We observe a jitter on iowait 5482.81 @1559876470.92 5482.81 @1559876480.92 5482.82 @1559876490.92 5482.81 @1559876500.92 5482.82 @1559876510.92 5482.82 @1559876520.92 5482.82 @1559876530.92

Till now, we only come across this issue on cpu iowait mode a couple of times.

jhaohai avatar Jun 07 '19 03:06 jhaohai

This is likely a kernel bug, as the node_exporter reads and passes the data from /proc/stat. I suggest you also examine the data in /proc/stat to see how the kernel is reporting.

while true ; do
  date +%s
  awk '$1 ~ /^cpu[0-9]+/ {print $1,$5}' /proc/stat
  sleep 10
done

SuperQ avatar Jun 07 '19 06:06 SuperQ

Are you sure these are the raw values? /proc/stat only includes integers for me but your paste shows floats..

discordianfish avatar Jun 18 '19 16:06 discordianfish

I just found a node in our environment exhibiting the same behavior.

This time it's a much more modern kernel, 4.15.0-1041-gcp.

17470.62 @1573028950.013
17470.62 @1573028965.013
17470.62 @1573028980.013
17470.62 @1573028995.013
17471.14 @1573029010.013
17471.46 @1573029025.013
17471.38 @1573029040.013
17472.69 @1573029055.013
17473.2 @1573029070.013
17475.32 @1573029085.013
17475.32 @1573029100.013
17478.02 @1573029115.013

SuperQ avatar Nov 06 '19 09:11 SuperQ

I wonder if this would help: https://github.com/prometheus/procfs/pull/231

SuperQ avatar Nov 06 '19 09:11 SuperQ

A workaround for this was implemented for https://github.com/prometheus/node_exporter/issues/1686.

SuperQ avatar Jul 20 '20 18:07 SuperQ