1:开启opacache[php.ini]
0 1 2 |
zend_extension=opcache.so opcache.enable=1 opcache.enable_cli=1 |
2:开启memcache[php.ini]编译Memcache (原生的Memcache 3.08版无法在PHP7下编译,故选用Github的pecl-memcache分支版本。)
0 1 2 3 4 5 6 7 8 |
https://github.com/websupport-sk/pecl-memcache/archive/php7.zip # FTP上传 cd pecl-memcache export PHP_PREFIX="/usr/local" $PHP_PREFIX/php70/bin/phpize ./configure --with-php-config=$PHP_PREFIX/php70/bin/php-config make && make install [memcache] extension = "memcache.so" extension_dir = "/usr/local/php/lib/php/extensions/dir/" |
3:PHP7 开启Opcache file cache[参考鸟哥博客][php.ini]
0 |
opcache.file_cache=/tmp |
4:Hugepage
0 1 2 3 |
[root@BY www]# grep vm.nr_hugepages /etc/sysctl.conf vm.nr_hugepages=512 [root@BY www]# grep huge_code_pages /usr/local/php/lib/php.ini opcache.huge_code_pages=1 |
参考文档:
1:http://www.laruence.com/2015/12/04/3086.html
2:https://note.t4x.org/environment/opcache-xcache-memcache/ SourceByrd's Weblog-https://note.t4x.org/service/php-optimization-tips/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!