Apache lebih banyak dikenal sebagai web server. Namun sebenarnya apache juga memiliki tool yang tersedia untuk melakukan benchmark request pada website. Benchmark ini untuk mengetahui jika terjadi banyak request pada website anda, dan bisa kah server meng-handle-nya load tersebut.
Untuk melakukannya juga sangat sederhana melalui perintah command line, dan bisa dilakukan jika sudah meng-install apache. Namun untuk memastikan package yang diinstall adalah :
sudo apt install apache2-utils
jika sudah terinstall, parameter perintahnya berupa :
ab -n 1000 -c 100 http://website.com/
penjelasan perintah diatas adalah melakukan 1000 request dengan melakukan grouping dalam 1 request 100 kali. Pastikan juga alamat website diakhiri tanda “/”
Jika perintah diatas saya test pada website saya sendiri, ini hasilnya :
ab -n 1000 -c 100 http://alfach.com/ This is ApacheBench, Version 2.3 <$Revision: 1807734 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking alfach.com (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Completed 1000 requests Finished 1000 requests Server Software: Apache Server Hostname: alfach.com Server Port: 80 Document Path: / Document Length: 288 bytes Concurrency Level: 100 Time taken for tests: 20.609 seconds Complete requests: 1000 Failed requests: 20 (Connect: 0, Receive: 0, Length: 20, Exceptions: 0) Non-2xx responses: 980 Total transferred: 1877820 bytes HTML transferred: 1708780 bytes Requests per second: 48.52 [#/sec] (mean) Time per request: 2060.944 [ms] (mean) Time per request: 20.609 [ms] (mean, across all concurrent requests) Transfer rate: 88.98 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 23 61 72.2 46 1285 Processing: 232 1049 2577.2 562 20560 Waiting: 232 1040 2527.2 562 20459 Total: 269 1109 2579.3 615 20608 Percentage of the requests served within a certain time (ms) 50% 615 66% 703 75% 800 80% 957 90% 1520 95% 2408 98% 14176 99% 19288 100% 20608 (longest request)