ab压力测试php网页,使用 Apache 的 ab 工具进行 PHP WordPress 的压力测试

使用 Apache 的 ab 工具测试了下几个网站的并发

本机配置

cbe44d4e3af88e1d93e0a4fd51e61a3f.png

本地测试 echo ‘hello world’

./ab -c10 -n1000 http://localhost/helloworld.php

3c7250c3c25dabf7ccab3942f6a62e45.png

Server Software: nginx/1.11.5

Server Hostname: wp.a.cc

Server Port: 80

Document Path: /helloworld.php

Document Length: 25 bytes

Concurrency Level: 10

Time taken for tests: 1.041 seconds

Complete requests: 1000

Failed requests: 12

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

Non-2xx responses: 1000

Total transferred: 219284 bytes

HTML transferred: 26776 bytes

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

Time per request: 10.414 [ms] (mean)

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

Transfer rate: 205.64 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 0 0.4 0 1

Processing: 2 10 4.7 9 22

Waiting: 2 10 4.6 8 22

Total: 3 10 4.7 9 22

测试 phpinfo()

./ab -c10 -n1000 http://localhost/phpinfo.php

341b7e038d593254f862e8084c841a7a.png

Server Software: nginx/1.11.5

Server Hostname: wp.a.cc

Server Port: 80

Document Path: /phpinfo.php

Document Length: 98215 bytes

Concurrency Level: 10

Time taken for tests: 4.408 seconds

Complete requests: 1000

Failed requests: 107

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

Non-2xx responses: 17

Total transferred: 96733608 bytes

HTML transferred: 96548186 bytes

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

Time per request: 44.083 [ms] (mean)

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

Transfer rate: 21429.39 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 0 0.4 0 1

Processing: 10 44 8.9 43 78

Waiting: 9 43 8.9 42 78

Total: 10 44 8.9 43 78

测试新装 WordPress

./ab -c10 -n100 http://localhost/wordpress/

b7b50af64a5aaca84733ba0fdba52cfd.png

Server Software: nginx/1.11.5

Server Hostname: wp.a.cc

Server Port: 80

Document Path: /wordpress/

Document Length: 52976 bytes

Concurrency Level: 10

Time taken for tests: 45.738 seconds

Complete requests: 100

Failed requests: 0

Total transferred: 5323100 bytes

HTML transferred: 5297600 bytes

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

Time per request: 4573.759 [ms] (mean)

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

Transfer rate: 113.66 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 0 0.5 0 1

Processing: 447 4366 790.2 4507 5239

Waiting: 446 4366 790.2 4507 5239

Total: 447 4367 790.2 4507 5240

WordPress 安装 WP Super Cache 缓存插件

./ab -c10 -n100 http://localhost/wordpress/

9f318213cf4f21aa1081d8f33f996762.png

Server Software: nginx/1.11.5

Server Hostname: wp.a.cc

Server Port: 80

Document Path: /wordpress/

Document Length: 53120 bytes

Concurrency Level: 10

Time taken for tests: 2.721 seconds

Complete requests: 100

Failed requests: 0

Total transferred: 5338000 bytes

HTML transferred: 5312000 bytes

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

Time per request: 272.131 [ms] (mean)

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

Transfer rate: 1915.58 [Kbytes/sec] received

Connection Times (ms)

min mean[+/-sd] median max

Connect: 0 0 0.4 0 1

Processing: 32 260 47.2 268 328

Waiting: 32 260 47.2 268 328

Total: 32 261 47.2 269 328

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值