Web Server程序編寫學習筆記(五)性能測試

        使用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)
/****************************************************/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章