http://www.laruence.com/2015/12/04/3086.html
开启了 HugePage , 性能又提升了,下面的测试,还是1核3G内存的阿里云(阿里云是4G内存,因为服务器有很多其他的应用,暂且定为3G内存)
appserver, 没有开启fecshop cache的ab测试结果
[root@iZ942k2d5ezZ ~]# ab -n 100 -c 10 http://fecshop.appserver.fancyecommerce.com/catalog/category/index?categoryId=57bea0e3f656f275313bf56e&sortColumn=&filterAttrs=%7B%7D&filterPrice=
[1] 28123
[2] 28124
[3] 28125
[root@iZ942k2d5ezZ ~]# This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking fecshop.appserver.fancyecommerce.com (be patient).....done
Server Software: nginx
Server Hostname: fecshop.appserver.fancyecommerce.com
Server Port: 80
Document Path: /catalog/category/index?categoryId=57bea0e3f656f275313bf56e
Document Length: 8628 bytes
Concurrency Level: 10
Time taken for tests: 2.241 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 903699 bytes
HTML transferred: 862800 bytes
Requests per second: 44.61 [#/sec] (mean)
Time per request: 224.150 [ms] (mean)
Time per request: 22.415 [ms] (mean, across all concurrent requests)
Transfer rate: 393.72 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 0
Processing: 72 222 25.1 221 310
Waiting: 17 173 22.1 175 206
Total: 72 222 25.1 221 310
Percentage of the requests served within a certain time (ms)
50% 221
66% 231
75% 236
80% 239
90% 249
95% 258
98% 269
99% 310
100% 310 (longest request)
结果:Requests per second: 44.61 [#/sec] (mean)
开启fecshop cache
[root@iZ942k2d5ezZ ~]# ab -n 100 -c 10 http://fecshop.appserver.fancyecommerce.com/catalog/category/index?categoryId=57bea0e3f656f275313bf56e&sortColumn=&filterAttrs=%7B%7D&filterPrice=
[1] 28357
[2] 28358
[3] 28359
[root@iZ942k2d5ezZ ~]# This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking fecshop.appserver.fancyecommerce.com (be patient).....done
Server Software: nginx
Server Hostname: fecshop.appserver.fancyecommerce.com
Server Port: 80
Document Path: /catalog/category/index?categoryId=57bea0e3f656f275313bf56e
Document Length: 8628 bytes
Concurrency Level: 10
Time taken for tests: 0.828 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 903601 bytes
HTML transferred: 862800 bytes
Requests per second: 120.84 [#/sec] (mean)
Time per request: 82.756 [ms] (mean)
Time per request: 8.276 [ms] (mean, across all concurrent requests)
Transfer rate: 1066.29 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 1
Processing: 26 81 19.0 83 143
Waiting: 7 61 15.7 62 110
Total: 26 81 19.1 83 143
Percentage of the requests served within a certain time (ms)
50% 83
66% 93
75% 96
80% 99
90% 102
95% 105
98% 123
99% 143
100% 143 (longest request)
[1] Done ab -n 100 -c 10 http://fecshop.appserver.fancyecommerce.com/catalog/category/index?categoryId=57bea0e3f656f275313bf56e
[2]- Done sortColumn=
[3]+ Done filterAttrs=%7B%7D
[root@iZ942k2d5ezZ ~]#
[root@iZ942k2d5ezZ ~]#
结果:Requests per second: 120.84 [#/sec] (mean)
可以看到开启 HugePage 后,没有开启fecshop cache的情况下,由30多到了44.6
,开启 fecshop cache的情况下,由98 到了120,性能提升了很多
鸟哥的php性能优化还有其他的一些细节,没有做配置。
因此开启hugePage对性能的提升还是很大的