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

Core usage anomaly #2363

Open
MattiaVerticchio opened this issue Jan 27, 2024 · 0 comments
Open

Core usage anomaly #2363

MattiaVerticchio opened this issue Jan 27, 2024 · 0 comments

Comments

@MattiaVerticchio
Copy link

Summary

  • OS: Fedora 39 Sway
  • CPU: Intel N100, 64bit
  • Psutil version: 5.9.5
  • Python version: 3.12.1
  • Type: core

Description

I encountered a bug when using the psutil.cpu_percent(interval=1, percpu=True) function. It returns a list of percentages for each CPU core, but the value for the third core is always very high (around 75-80%) even when the CPU is idling. This does not match the CPU usage shown by Gnome System Monitor.

Screenshot

image

Code
import psutil
import time

for _ in range(10):
    print(psutil.cpu_percent(interval=1, percpu=True))
    time.sleep(1)
Output
[5.0, 1.0, 76.0, 1.0]
[2.0, 3.0, 75.0, 3.0]
[3.0, 0.0, 75.0, 3.0]
[1.0, 4.0, 75.8, 1.0]
[1.0, 4.0, 75.2, 3.0]
[1.0, 1.0, 75.2, 3.0]
[1.0, 2.0, 75.0, 3.0]
[2.0, 5.0, 75.8, 4.0]
[2.0, 6.0, 75.0, 1.0]
[1.0, 4.0, 75.8, 5.0]

I hope this is helpful, thank you for your work on this library! 😁

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

No branches or pull requests

1 participant