elasticsearch_exporter icon indicating copy to clipboard operation
elasticsearch_exporter copied to clipboard

os_cpu_percent flawed

Open h-hmz opened this issue 4 years ago • 4 comments

Hello,

I am using Opendistro 1.13.0 (Elasticsearch 7.10.2) and exporter v1.2.1, and I noticed that the elasticsearch_process_cpu_percent is always flawed in my context.

For example, I can see through _nodes/stats that current cpu utilization is averaging 70%, however process_cpu_percent will return 0, 1 or 2% at most...

My cluster is hosted through docker containers, I know sometimes this can distort cpu or memory metrics for tools like top or free that fetch this value from /proc/meminfo, which is actually returning the utilization of the hosting node instead of the container.

Any idea how to get around this problem?

h-hmz avatar Sep 23 '21 16:09 h-hmz

+1

zcola avatar Nov 10 '21 06:11 zcola

When you query _nodes/stats, what is the value of process.cpu.percent? That's the exact value that should be returned by the exporter.

sysadmind avatar Nov 17 '21 16:11 sysadmind

what _nodes/stats returns should be the cpu percent of the host, assume it's A. But if cpu limit was set when running the docker, the real cpu percent of this node should be A * total_host_cpu / cpu_in_use

jingleniko avatar Nov 19 '21 07:11 jingleniko

+1 i have not set cpu limit, and have the same situation.

what _nodes/stats returns should be the cpu percent of the host, assume it's A. But if cpu limit was set when running the docker, the real cpu percent of this node should be A * total_host_cpu / cpu_in_use

yamin-zou avatar Jun 25 '23 07:06 yamin-zou