Skip to content
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

Report Busiest Thread in terms of CPU Usage #48

Closed
PeterZaitsev opened this issue Aug 4, 2018 · 2 comments
Closed

Report Busiest Thread in terms of CPU Usage #48

PeterZaitsev opened this issue Aug 4, 2018 · 2 comments

Comments

@PeterZaitsev
Copy link

Process Exporter already reports the worst FD Usage Ratio for processes in the group

namedprocess_namegroup_worst_fd_ratio{groupname="agetty"} 0.00390625

It would be great to apply the same to get the metrics for the busiest CPU thread in the group. This is helpful to understand when particular thread is CPU bound.

OkMeter has good description of this idea
https://okmeter.io/docs/processes

@ncabatoff
Copy link
Owner

There is an existing option that should satisfy your need: enable thread-based metrics using the -threads option. Then use the metric namedprocess_namegroup_thread_cpu_seconds_total.

I've updated the README to give more details.

@PeterZaitsev
Copy link
Author

Hi Nick,

I was able to verify your solution and it does not work. --threads seems to do the grouping by thread name and not thread_id, which are really set in reality even if they are they are not unique.

For example for MySQL I see:

namedprocess_namegroup_thread_cpu_seconds_total{cpumode="user",groupname="mysqld",threadname="mysqld"} 1.1299999999996544

Only one line even through MySQL has 300 threads on this box.

I think being able to spot the hot threads is quite valuable as CPU usage itself does not make a difference whenever one thread was using CPU or multiple

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants