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

Question of Nginx CPU usage under wrk stress test #531

Open
zhongweiy opened this issue Nov 2, 2023 · 2 comments
Open

Question of Nginx CPU usage under wrk stress test #531

zhongweiy opened this issue Nov 2, 2023 · 2 comments

Comments

@zhongweiy
Copy link

when doing Nginx stress test by running test cmd: wrk -t1 -c40 -d50s http://127.0.0.1:80, I find the worker process of Nginx is not using 100% CPU, it is only 70% (from top command). I have tried different wrk options like -t10 -c400, CPU usage can not pass 70%.

Do you have any suggestion to achieve 100% CPU usage under stressing test with wrk?

I also did a little bit more analysis. I was thinking the process was some how sheduled out due to some blocking call. But the bcc offcputime tool's offcpu time flame graph only has 1ms off cpu event for a 50 second record for the Nginx worker process. I expect there will be 30% * 50 sec = 15 sec offcput event. Am I missing something here?

@gaowanlu
Copy link

maybe,try it.

wrk -t 5 -c 10000 -d50s --header "Connection: close" --header "Cache-Control: no-cache" http://127.0.0.1:80/

@gaowanlu
Copy link

Adjust the '-t' based on CPU core count.

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