php7.0 7.1 7.2,缙哥哥的博客升级到PHP7.2,附PHP7.1与7.2对比

缙哥哥在去年就已经使用PHP7版本了,那时就说PHP7比老版本快了很多很多,在今年,又分别出了7.1和7.2版本,从 WordPress 4.9.3 开始,该版本修复了 4.9 以来的34个问题。包括外观定制器更改、小工具、可视编辑器和php 7.2兼容性的修复。在缙哥哥做了一些对比后,最终决定将博客环境升级到PHP7.2版本。

PHP7.1/7.2对比图表呈现汇总bench.phpbench.php + opcachemicro_bench.phpmicro_bench.php + opcachePHP7.11.38590.81335.63654.3600

PHP7.21.45140.78675.58403.7234

wordpress 压测

未开启 opcache# php7.1

Concurrency Level: 10

Time taken for tests: 8.696 seconds

Complete requests: 100

Failed requests: 0

Write errors: 0

Total transferred: 5215300 bytes

HTML transferred: 5189300 bytes

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

Time per request: 869.637 [ms] (mean)

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

Transfer rate: 585.65 [Kbytes/sec] received# php7.2

Concurrency Level: 10

Time taken for tests: 8.528 seconds

Complete requests: 100

Failed requests: 0

Write errors: 0

Total transferred: 5215500 bytes

HTML transferred: 5189300 bytes

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

Time per request: 852.793 [ms] (mean)

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

Transfer rate: 597.24 [Kbytes/sec] received

可以看到在未开启opcache的情况下,性能非常糟糕,10个并发的情况下,每个请求的响应时间已经非常长了,没有必要继续增加并发数了。

开启 opcache 之后汇总7.1 Requests per second (每秒)7.1 Time per request (ms)7.2 Requests per second (每秒)7.2 Time per request (ms)c10 n10060.63164.93970.05142.762

c20 n20066.27301.80370.74282.719

c30 n30066.50451.12170.89423.2

c40 n40067.95588.68370.6566.608

在开启opcache 之后,相对之前未开启的情况性能简直天壤之别。相比之下php7.2在wordpress压测上,QPS 稳定在70+ 相对php7.1 增加不少。

测试结果和配置参数以及服务器配置有关,仅供对比php7.1与7.2的性能。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值