Monday, July 26, 2010

Apache Bench test

Apache bench test can be done to find the apache server performance.
We can run multiple simultaneous connections to the apache server and check the server response time.

Download apace bench marker from the below site.
http://www.filewatcher.com/m/ApacheBench-0.62.tar.gz.61627.0.0.html


Install Apache Bench mark -
wget ftp://ftp.eenet.ee/pub/cpan/authors/id/A/AD/ADIRAJ/ApacheBench-0.62.tar.gz
mv ApacheBench-0.62.tar.gz to /opt

tar -zxvf ApacheBench-0.62.tar.gz
cd /opt/ApacheBench-0.62
perl Makefile.PL
make
make test (requires Term::ReadKey for execute() test)
make install

Now AB is installed you can run the testing from command.
ab -n 10000 -c 5 http://(servername)/index.html

-n requests Number of requests to perform
-c concurrency Number of multiple requests to make

Result
=====
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 xxx.xxx.xxx.xxx (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests


Server Software: Apache/2.2.10
Server Hostname:
Server Port: 80

Document Path: /index.html
Document Length: 197 bytes

Concurrency Level: 10
Time taken for tests: 6.98762 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 4440000 bytes
HTML transferred: 1970000 bytes
Requests per second: 1639.68 [#/sec] (mean)
Time per request: 6.099 [ms] (mean)
Time per request: 0.610 [ms] (mean, across all concurrent requests)
Transfer rate: 710.80 [Kbytes/sec] received

=========