ทดสอบ server ด้วย ApacheBench
ab -n-c :
-n คือ จำนวนครั้งในการทดสอบ (Number of requests)
-c คือ การส่งทดสอบพร้อมๆ กัน (concurrency)
ตัวอย่าง
$ ab -n 100 -c 20 http://lafayettecc.org/lcc_live/event/132/progress 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 lafayettecc.org (be patient).....done Server Software: nginx/1.4.6 Server Hostname: lafayettecc.org Server Port: 80 Document Path: /lcc_live/event/132/progress Document Length: 193 bytes Concurrency Level: 20 Time taken for tests: 13.233 seconds Complete requests: 100 Failed requests: 1 (Connect: 0, Receive: 0, Length: 1, Exceptions: 0) Non-2xx responses: 100 Total transferred: 41897 bytes HTML transferred: 19126 bytes Requests per second: 7.56 [#/sec] (mean) Time per request: 2646.506 [ms] (mean) Time per request: 132.325 [ms] (mean, across all concurrent requests) Transfer rate: 3.09 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 4 8 1.5 8 10 Processing: 532 702 1203.1 604 12609 Waiting: 532 702 1203.2 604 12609 Total: 537 709 1203.3 613 12619 Percentage of the requests served within a certain time (ms) 50% 613 66% 614 75% 614 80% 614 90% 614 95% 615 98% 615 99% 12619 100% 12619 (longest request)
https://spalinux.com/2012/06/benchmark-web-server-using-ab-apachebench