配置指令如下:
[opcache] zend_extension=opcache.so opcache.enable_cli=1 ;共享内存大小, 这个根据你们的需求可调 opcache.memory_consumption=256 ;interned string的内存大小, 也可调 opcache.interned_strings_buffer=8 ;最大缓存的文件数目 opcache.max_accelerated_files=4000 ;60s检查一次文件更新 opcache.revalidate_freq=60 ;打开快速关闭, 打开这个在PHP Request Shutdown的时候 会收内存的速度会提高 opcache.fast_shutdown=1 ;不保存文件/函数的注释 opcache.save_comments=0
实际性能对比:
下面是实际测试中没有开启opcache的数据:
[root@localhost ~]# ab -n 10000 -c 200 "http://112.126.69.14/main.php" 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 112.126.69.14 (be patient) Completed 1000 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests Completed 10000 requests Finished 10000 requests Server Software: openresty/1.7.2.1 Server Hostname: 112.126.69.14 Server Port: 80 Document Path: /main.php"htmlcode">[root@localhost ~]# ab -n 10000 -c 200 "http://112.126.69.14/main.php" 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 112.126.69.14 (be patient) Completed 1000 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests Completed 10000 requests Finished 10000 requests Server Software: openresty/1.7.2.1 Server Hostname: 112.126.69.14 Server Port: 80 Document Path: /main.php?a=Role&m=createRole Document Length: 2 bytes Concurrency Level: 200 Time taken for tests: 14.237 seconds Complete requests: 10000 Failed requests: 0 Write errors: 0 Total transferred: 1711710 bytes HTML transferred: 20020 bytes Requests per second: 702.40 [#/sec] (mean) Time per request: 284.739 [ms] (mean) Time per request: 1.424 [ms] (mean, across all concurrent requests) Transfer rate: 117.41 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 2 66 272.6 2 3005 Processing: 4 176 666.4 6 9026 Waiting: 4 163 642.8 6 9026 Total: 6 242 745.7 9 10028 Percentage of the requests served within a certain time (ms) 50% 9 66% 14 75% 99 80% 122 90% 1006 95% 1476 98% 2853 99% 3543 100% 10028 (longest request)以上所述就是本文的全部内容,希望大家能够喜欢。
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
暂无评论...
更新日志
2024年11月27日
2024年11月27日
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]