wg / wrk

Modern HTTP benchmarking tool
Other
37.65k stars 2.93k forks source link

Question of Nginx CPU usage under wrk stress test #531

Open zhongweiy opened 10 months ago

zhongweiy commented 10 months ago

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 commented 4 months ago

maybe,try it.

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

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