Question of Nginx CPU usage under wrk stress test
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?
maybe,try it.
wrk -t 5 -c 10000 -d50s --header "Connection: close" --header "Cache-Control: no-cache" http://127.0.0.1:80/
Adjust the '-t' based on CPU core count.