1. 程式人生 > >http,https,TCP,UDP,apache 的ab,壓測工具

http,https,TCP,UDP,apache 的ab,壓測工具

對於http,https使用apache 的ab

對於http/2使用nghttp2的h2load

壓測http

ab -k -t 180 -c 6 -n 1000000 http://172.16.37.66/index.html

http2.0之壓測

h2load -c 6 -T 180 -n 1000000 https://172.16.37.66/index.html

TCP/UDP壓測工具 (https://wiki.swoole.com/wiki/page/197.html)

php run.php -c 100 -n 10000 -s tcp://127.0.0.1:9501 -f long_tcp

測試完成後,列印的結果為:

concurrency:    100 //併發數量
request num:    10000 //請求總數
lost num:   0 //失敗次數
success num:    10000 //成功次數
total time: 0.157 //總耗時
req per second: 63558 //qps,每秒處理的請求數
one req use(ms):    0.015  //單個請求的平均時長,此結果目前不準確,請勿作為參考