接下来使用楼主的 oneinstack 编译安装,尽量选择了和源安装一样版本的组件
PHP 5.4.45 / MySQL 5.6.29 / nginx 1.9.14
使用自带脚本新建虚拟主机安装 WordPress, 没有做任何性能相关的配置调整
其 PHP 配置为:
pm = dynamic
pm.max_children = 4
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 4
pm.max_requests = 2048
pm.process_idle_timeout = 10s
结果:
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
http://www.zeustech.net/Licensed to The Apache Software Foundation,
http://www.apache.org/Benchmarking x.x.x.169 (be patient)
Server Software: nginx
Server Hostname: x.x.x.169
Server Port: 80
Document Path: /?paged=2
Document Length: 48542 bytes
Concurrency Level: 50
Time taken for tests: 6709.842 seconds
Complete requests: 25000
Failed requests: 0
Total transferred: 1218475000 bytes
HTML transferred: 1213550000 bytes
Requests per second: 3.73 [#/sec] (mean)
Time per request: 13419.683 [ms] (mean)
Time per request: 268.394 [ms] (mean, across all concurrent requests)
Transfer rate: 177.34 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 2
Processing: 1025 13407 1253.2 12827 19857
Waiting: 1024 13407 1253.1 12827 19857
Total: 1027 13407 1253.2 12827 19857
Percentage of the requests served within a certain time (ms)
50% 12827
66% 13784
75% 14249
80% 14535
90% 15274
95% 15782
98% 16355
99% 16821
100% 19857 (longest request)
结果略好于源安装,总时间较短但单个请求消耗的时间分布更散一些,这个结果比较符合我心目中自己编译的效果(没有明显性能优势但应当和集中打包的二进制表现相当或者略好) @
vibbow @
yesono 以及这次的两个结果明显比两年前的要好(物理机是同一台,而且我还专门找了老版本的 WordPress 来减少变量),说明程序本身的进步也不容忽视
为了排除进程切换的影响,我正在用和脚本配置一样的 php 在源安装的机器上跑第三遍