umamahesh_nyros

Joined: 17 Jul 2007 Posts: 224 Location: KAKINADA
|
Posted: Mon Jun 01, 2009 7:30 am Post subject: apache benchmark(ab) to check perfomance of the server |
|
|
Apache benchmark is used to check the performance of the server. It is designed to give you an impression of how your current Apache performs. This especially shows you how many requests per second your Apache installation is capable of serving.
You can benchmark Apache by using apache benchmarking tool called ab.
its mainly used to check the average time it will take when you have a maximum number of users on your site simultaneously. Another important thing is how much more time it will take when there are 2 times more users: a server that take 2 times more for 2 times more users is better than another that take 4 times more for the same amount of users
the main command we use in this process is "top" and "uptime" command.
Login to SSH shell and type following command:
> ab -n 100 templatesbasket.com/
will send 100 requests to Apache server of templatesbasket’s web site. Here it’s output:
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking templatesbasket.com (be patient).....done
Server Software: Apache/2.2.3
Server Hostname: templatesbasket.com
Server Port: 80
Document Path: /
Document Length: 281 bytes
Concurrency Level: 1
Time taken for tests: 22.87165 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-* responses: 100
Total transferred: 49000 bytes
HTML transferred: 28100 bytes
Requests per second: 4.53 [#/sec] (mean)
Time per request: 220.872 [ms] (mean)
Time per request: 220.872 [ms] (mean, across all concurrent requests)
Transfer rate: 2.13 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 88 100 5.5 100 133
Processing: 113 119 4.3 118 132
Waiting: 111 116 4.4 115 128
Total: 205 220 9.0 219 259
Percentage of the requests served within a certain time (ms)
50% 219
66% 222
75% 230
80% 231
90% 231
95% 234
98% 239
99% 259
100% 259 (longest request)
some more useful commands,
> ab -n 1000 -c 5 http://203.76.196.3/somepage.html
-n 1000: ab will send 1000 number of requests to server 203.76.196.3 in order to perform for the benchmarking session
-c 5 : 5 is concurrency number i.e. ab will send 5 number of multiple requests to perform at a time to server 202.54.200.1
For example if you want to send 10 request, type following command:
> ab -n 10 -c 2 http://www.yourdomain.com/
the above commands will display the result of performance issue with all necessary details. |
|