'ab' program freezes after lots of requests, why?

后端 未结 3 524
南旧
南旧 2020-11-30 19:44

Whenever I use \'ab\' to benchmark a web server, it will freeze for a while after having sent lots of requests, only to continue after 20 seconds or so.

Consider the

3条回答
  •  猫巷女王i
    2020-11-30 20:24

    Another option to solve the issue is to enable HTTP KeepAlive by adding the "-k" option. This will make ab to re-use the TCP connections and as consequence it won't exhaust all ports available. For example:

    ab -n 45000 -c 10 -k http://127.0.0.1:3000/

提交回复
热议问题