步骤很简单一共两步,安装一步,使用一步。
sudo apt-get install apache2-utils
ab -n 10000 -c 100 https://www.baidu.com/
注意:
使用ubuntu16.04安装ab是非常便捷的,为了防止安装失败造成的影响,安装成功后,最好还是ab -V确认一下。
测试结果如下:
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking www.baidu.com (be patient).....doneServer Software: ???????BWS/1.1Server Hostname: ???????www.baidu.comServer Port: ???????????443SSL/TLS Protocol: ??????TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128Document Path: ?????????/Document Length: ???????227 bytesConcurrency Level: ?????10Time taken for tests: ??5.685 secondsComplete requests: ?????100Failed requests: ???????0Total transferred: ?????89300 bytesHTML transferred: ??????22700 bytesRequests per second: ???17.59 [#/sec] (mean)Time per request: ??????568.508 [ms] (mean)Time per request: ??????56.851 [ms] (mean, across all concurrent requests)Transfer rate: ?????????15.34 [Kbytes/sec] receivedConnection Times (ms) ?????????????min ?mean[+/-sd] median ??maxConnect: ??????26 ?349 605.2 ????71 ???4168Processing: ????8 ?100 125.5 ????21 ????611Waiting: ???????7 ??93 125.0 ????12 ????608Total: ????????42 ?449 687.6 ????90 ???4478Percentage of the requests served within a certain time (ms) ?50% ????90 ?66% ???571 ?75% ???677 ?80% ???759 ?90% ??1179 ?95% ??1703 ?98% ??3771 ?99% ??4478 100% ??4478 (longest request)
Apache AB的安装和使用(Ubuntu16.04)
原文地址:https://www.cnblogs.com/youcong/p/10110402.html