Web Server程序编写学习笔记(五)性能测试

类别:编程语言 点击:0 评论:0 推荐:

        使用apache自带的HTTP服务器性能测试工具ab对上述程序在FreeBSD和windows(Cygwin)下的运行情况进行测试。
        网路条件:局域网,192.168.1.7分别在FreeBSD和windows(Cygwin)下运行服务器程序,192.168.1.27运行ab测试程序对服务器程序进行测试;
        机器硬件条件:Intel (R) Celeron CPU 2.40GHz;256DDR,Maxtor 80G。
        1. FreeBSD 4.7环境:
/*****************************************************/
C:\>ab -n 1000 -c 50 192.168.1.7/124
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.7 (be patient)


Server Software:        mypngserver
Server Hostname:        192.168.1.7
Server Port:            80

Document Path:          /124
Document Length:        188 bytes

Concurrency Level:      50
Time taken for tests:   77.831917 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      346000 bytes
HTML transferred:       188000 bytes
Requests per second:    12.85 [#/sec] (mean)
Time per request:       3891.596 [ms] (mean)
Time per request:       77.832 [ms] (mean, across all concurrent requests)
Transfer rate:          4.33 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   77  41.7    100     100
Processing:    10 3718 481.4   3805    3905
Waiting:        0 1997 1104.4   2002    3905
Total:        110 3796 481.8   3905    3905

Percentage of the requests served within a certain time (ms)
  50%   3905
  66%   3905
  75%   3905
  80%   3905
  90%   3905
  95%   3905
  98%   3905
  99%   3905
 100%   3905 (longest request)
/*************************************************************/

        2. Windows XP (Cygwin)环境:
/*****************************************************/
C:\>ab -n 1000 -c 50 192.168.1.7/qwe
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.1.7 (be patient)


Server Software:        mypngserver
Server Hostname:        192.168.1.7
Server Port:            80

Document Path:          /qwe
Document Length:        193 bytes

Concurrency Level:      50
Time taken for tests:   719.454525 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      351000 bytes
HTML transferred:       193000 bytes
Requests per second:    1.39 [#/sec] (mean)
Time per request:       35972.726 [ms] (mean)
Time per request:       719.455 [ms] (mean, across all concurrent requests)
Transfer rate:          0.48 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0  712 311.2    520    1191
Processing:  4326 34387 4359.4  35221   36192
Waiting:     3815 20803 9140.2  20769   36111
Total:       5127 35099 4359.4  36111   36933

Percentage of the requests served within a certain time (ms)
  50%  36111
  66%  36212
  75%  36312
  80%  36392
  90%  36612
  95%  36712
  98%  36812
  99%  36822
 100%  36933 (longest request)
/****************************************************/

本文地址:http://com.8s8s.com/it/it23773.htm