Thursday, July 22, 2010

Web Server Benchmarking

1.Web site load analysis
2.performance tests

Web server benchmarking is useful in testing your infrastructure to see if it can with stand expected visitor growth and maintain a reasonable response under load
(i.e. requests per sec, latency, bandwidth).

>>Apache Benchmark Tool: ab
>>Benchmarking Tool: httperf

Apache Benchmark Tool: ab

The Apache httpd web server comes with a benchmarking tool to simulate a high load and to gather data for analysis.

>ab -n 1000 -c 10 -g test_data.txt http://www.karthik.com/index.html

Option Description
-n number of requests. Default is 1 which is useless.
-c concurrent requests. Default 1
-g GNU plot output. Labels are on first line of output.
-q Suppress progress stattus output to stderr.
-t Time limit. Maximum number of seconds.
-A username:password Specify authentication credentials.
-X proxy[:port] Specify a proxy server.

Console output:
Finished 1000 requests


Server Software: Apache/2.2.3
Server Hostname: www.karthik.com
Server Port: 80

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

Concurrency Level: 10
Time taken for tests: 14.793312 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 83608000 bytes
HTML transferred: 83241000 bytes
Requests per second: 67.60 [#/sec] (mean)
Time per request: 147.933 [ms] (mean)
Time per request: 14.793 [ms] (mean, across all concurrent requests)
Transfer rate: 5519.25 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 20 250.2 0 3000
Processing: 53 126 52.7 120 317
Waiting: 19 51 29.5 46 246
Total: 53 147 260.2 120 3305

Percentage of the requests served within a certain time (ms)
50% 120
66% 142
75% 159
80% 172
90% 198
95% 227
98% 282
99% 314
100% 3305 (longest request)

This shows the load limit of the server.
---------------------------------------------------------------------------------

Benchmarking Tool: httperf


Web performance benchmarking tool httperf. Httperf sends requests to the web server at a specified rate and gathers stats. Increase till one finds the saturation point.
Installation:

* apt-get install httperf

Example usage:

* Print performance stats for home page of your-domain.com: httperf --hog --server www.your-domain.com
* Create 100 connections at a rate of 10/sec: httperf --hog --server http://www.your-domain.com/ --num-conn 100 --rate 10 --timeout 5
* Generate 10 sessions at a rate of one session/sec every 2 seconds: httperf --hog --ser=www --wsess=10,5,2 --rate 1 --timeout 5

httperf command line options:

Command Command Description
--hog Use as many TCP ports as necessary to generate stats (else limited to port 1024-5000)
--num-calls Session oriented workloads.
--max-connections=# Limit the number of connections to that specified.
--num-calls=# Specify the number of calls to issue on each connection before closing it.
--server host-name Default localhost. Specify IP address of host name.
--wsess=N1,N2,X Specify session where
N1: number of sessions
N2: number of calls per session
X: delay between calls (sec)
--timeout Stop if there is no response within timeout period.

No comments:

Post a Comment