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

CPU usage #55

Open
ducarios opened this issue Sep 12, 2019 · 5 comments
Open

CPU usage #55

ducarios opened this issue Sep 12, 2019 · 5 comments

Comments

@ducarios
Copy link

Why does the percentage of CPU usage exceed 100%? I do not understand why the values written to the log file exceed 100.

thx for the help.

@miguelcarcamov
Copy link

Same here, sometimes I get 6000% with a process that uses openmp, even if I divide the percentage by my number of CPUs (8), the resultant percentage does not make sense to me.

I would it be nice if someone can explain us why percentage exceed 100%.

Cheers

@humbletroll
Copy link

Same here, sometimes I get 6000% with a process that uses openmp, even if I divide the percentage by my number of CPUs (8), the resultant percentage does not make sense to me.

I would it be nice if someone can explain us why percentage exceed 100%.

Cheers

From what I have seen using other libraries, it seems the usage is of all threads. It can be that program is using only 6 threads. It's a theory tho. I can't say if it is true or not.

@astrofrog
Copy link
Owner

In some cases this can be due to multi-threading, but I sometimes see this for single-threaded processes, and it can usually be fixed by specifying the interval explicitly, e.g. --interval 0.1. If the interval is too short, there are some numerical issues with determining the CPU % I think.

@pabluk
Copy link

pabluk commented May 29, 2020

just for the record, I observed the same behavior and as psrecord is using the function cpu_percent() from psutil I found an explanation on its documentation https://psutil.readthedocs.io/en/latest/#psutil.Process.cpu_percent:

the returned value can be > 100.0 in case of a process running multiple threads on different CPU cores.

@we-taper
Copy link

Related question in psutil.

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

6 participants