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

Idle cpu consumption #3411

Open
belovaf opened this issue Jun 23, 2024 · 3 comments
Open

Idle cpu consumption #3411

belovaf opened this issue Jun 23, 2024 · 3 comments

Comments

@belovaf
Copy link

belovaf commented Jun 23, 2024

Expected Behavior

Actix doesn't consume cpu while idle.

Current Behavior

Actix constantly consumes 0.1% cpu while idle.

Steps to Reproduce (for bugs)

Start hello world actix server.

Context

I have tested other web frameworks: axum, ntex. They don't consume any cpu while idle as expected.

Your Environment

  • Rust Version (I.e, output of rustc -V): 1.79
  • Actix Web Version: 4.8.0
@belovaf
Copy link
Author

belovaf commented Jun 24, 2024

It looks like actix-web contains a busy-loop.
My system monitor shows that an actix process constantly increases the number of "Idle Wake Ups":
Number of times a thread caused the system to wake up from idleness to begin executing the thread.

@belovaf
Copy link
Author

belovaf commented Jun 24, 2024

I tried to debug and I see that actix-server worker threads are busy-looping.
Worker threads are constantly parked / unparked.

image

@belovaf
Copy link
Author

belovaf commented Jun 24, 2024

Also the process system call counter is constantly increasing while idle.

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

2 participants