手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

安装Xcache缓存加速php及ab压力测试结果

[日期:2015-08-22] 来源:Linux社区  作者:mofansheng [字体:大 中 小]

ab压力测试进行对比:未安装xcache与安装xcache

使用DELL R420真机(使用discuz论坛首页测试)

在另一台机器上,使用ab压力测试;未安装xcache,3000次并发为118; 3万次并发为74-94之间;

[root@localhost ~]# ab -n 3000 -c 100 www.linuxidc.com/forum.php

This is ApacheBench, Version 2.3 <$Revision: 655654 $>

Server Software:        Apache

Server Hostname:        www.linuxidc.com

Server Port:            80

Document Path:          /forum.php

Document Length:        13222 bytes

Concurrency Level:      100

Time taken for tests:  25.247 seconds

Complete requests:      3000

Failed requests:        0

Write errors:          0

Total transferred:      42018000 bytes

HTML transferred:      39666000 bytes

Requests per second:    118.82 [#/sec] (mean)  #每秒处理的请求数

Time per request:      841.579 [ms] (mean)

Time per request:      8.416 [ms] (mean, across all concurrent requests)

Transfer rate:          1625.25 [Kbytes/sec] received

Connection Times (ms)

              min  mean[+/-sd] median  max

Connect:        1    4  9.0      2      85

Processing:    66  827 441.1    967    2003

Waiting:      55  812 437.8    953    1992

Total:        68  831 442.2    970    2031

Percentage of the requests served within a certain time (ms)

  50%    970

  66%  1085

  75%  1147

  80%  1187

  90%  1295

  95%  1411

  98%  1680

  99%  1791

 100%  2031 (longest request)

可以查看日志记录也是3000条

[root@localhost logs]# cat linuxidc.com-access_log_20150820.log|wc -l

3000

请求为3万次,测试结果如下:

[root@localhost ~]# ab -n 30000 -c 100 www.linuxidc.com/forum.php

Server Software:        Apache

Server Hostname:        www.linuxidc.com

Server Port:            80

Document Path:          /forum.php

Document Length:        13222 bytes

Concurrency Level:      100

Time taken for tests:  402.065 seconds

Complete requests:      30000

Failed requests:        2

  (Connect: 0, Receive: 0, Length: 2, Exceptions: 0)

Write errors:          0

Total transferred:      420614188 bytes

HTML transferred:      397069884 bytes

Requests per second:    74.61 [#/sec] (mean)

Time per request:      1340.216 [ms] (mean)

Time per request:      13.402 [ms] (mean, across all concurrent requests)

Transfer rate:          1021.62 [Kbytes/sec] received

Connection Times (ms)

              min  mean[+/-sd] median  max

Connect:        1  170 639.2      4    7553

Processing:    60 1161 1108.3  1037    9234

Waiting:      54  911 534.1    975    7633

Total:        63 1331 1406.5  1068  12650

Percentage of the requests served within a certain time (ms)

  50%  1068

  66%  1208

  75%  1323

  80%  1482

  90%  2672

  95%  4181

  98%  6083

  99%  7630

 100%  12650 (longest request)

系统负载,最高达到88

安装Xcache缓存加速php及ab压力测试结果

开启xcache缓存后,3000次请求并发为368;3万次请求并发为103;系统负载最高只有2-4;

[root@localhost ~]# ab -n 3000 -c 100 http://www.linuxidc.com/forum.php

Server Software:        Apache

Server Hostname:        www.linuxidc.com

Server Port:            80

Document Path:          /forum.php

Document Length:        12579 bytes

Concurrency Level:      100

Time taken for tests:  8.132 seconds

Complete requests:      3000

Failed requests:        8

  (Connect: 0, Receive: 0, Length: 8, Exceptions: 0)

Total transferred:      39787499 bytes

HTML transferred:      37732203 bytes

Requests per second:    368.90 [#/sec] (mean)

Time per request:      271.079 [ms] (mean)

Time per request:      2.711 [ms] (mean, across all concurrent requests)

Transfer rate:          4777.81 [Kbytes/sec] received

Connection Times (ms)

              min  mean[+/-sd] median  max

Connect:        1  36  29.8    27    141

Processing:    27  230 112.0    222    919

Waiting:      17  196 104.1    178    864

Total:        31  266 107.4    252    951

Percentage of the requests served within a certain time (ms)

  50%    252

  66%    298

  75%    333

  80%    352

  90%    398

  95%    452

  98%    518

  99%    592

 100%    951 (longest request)

请求为3万次,测试结果如下:

[root@localhost ~]# ab -n 30000 -c 100 http://www.linuxidc.com/forum.php

Server Software:        Apache

Server Hostname:        www.linuxidc.com

Server Port:            80

Document Path:          /forum.php

Document Length:        13233 bytes

Concurrency Level:      100

Time taken for tests:  290.761 seconds

Complete requests:      30000

Failed requests:        29963

  (Connect: 0, Receive: 0, Length: 29963, Exceptions: 0)

Total transferred:      397977862 bytes

HTML transferred:      377424199 bytes

Requests per second:    103.18 [#/sec] (mean)

Time per request:      969.202 [ms] (mean)

Time per request:      9.692 [ms] (mean, across all concurrent requests)

Transfer rate:          1336.67 [Kbytes/sec] received

Connection Times (ms)

              min  mean[+/-sd] median  max

Connect:        1  273 830.2      7    5700

Processing:    18  693 1404.2    249    7851

Waiting:      14  366 547.2    212    5480

Total:        19  967 2080.8    276  12416

Percentage of the requests served within a certain time (ms)

  50%    276

  66%    382

  75%    480

  80%    567

  90%  2453

  95%  6768

  98%  9107

  99%  9879

 100%  12416 (longest request)

每次ab压力测试的结果都不太准确,在虚拟机测试结果更不靠谱。特意找的真机测试,除了负载较高,内存使用竟然没太大变化;只能做参考用;

本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-08/122108.htm

linux
相关资讯       XCache  Xcache缓存  ab压力测试 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款