快捷搜索:  

IIS6.0环境用FastCGI模式加载php的性能测试(4)


还是用上面的方法进行简单的压力测试

ab -n 1000 -c 20 http://192.168.0.6/abu.php

模拟出总共1000个网站请求,并发20个请求,访问服务器http://192.168.0.6/abu.php 页面

如下图:

 


点击可以看到大图

注意看CPU消耗小了很多,为了确保数据相对准确,隔了一会儿又再次做了两次测试


  



这是我在服务器上的截图,我们可以发现,基本上CPU的消耗在30-40%左右。

我本机完整的记录见下面:

C:\>ab -n 1000 -c 20 http://192.168.0.6/abu.php
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 192.168.0.6 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        Microsoft-IIS/6.0
Server Hostname:        192.168.0.6
Server Port:            80

Document Path:          /abu.php
Document Length:        52903 bytes

Concurrency Level:      20
Time taken for tests:   55.234375 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      53101000 bytes
HTML transferred:       52903000 bytes
Requests per second:    18.10 [#/sec] (mean)
Time per request:       1104.688 [ms] (mean)
Time per request:       55.234 [ms] (mean, across all concurrent requests)
Transfer rate:          938.84 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:          17.3         453
Processing:   500 1088 143.9   1062    1796
Waiting:       46  246  98.0    218     734
Total:        500 1095 145.1   1062    1796

Percentage of the requests served within a certain time (ms)
  50%   1062
  66%   1078
  75%   1093
  80%   1109
  90%   1156
  95%   1421
  98%   1687
  99%   1718
 100%   1796 (longest request)



三、ISAPI和FastCGI两种模式对比测试的结果

根据上面的简单测试,我们可以发现,相同硬件环境下,FastCGI方式加载PHP环境比ISAPI方式加载PHP性能提高约1倍。

把服务器换成FastCGI方式加载PHP了,性能有了明显的提高。又可以继续压榨可怜的服务器,心里十分开心。

顶(0)
踩(0)

您可能还会对下面的文章感兴趣:

最新评论