php5.5以上编译安装时带上–enable-opcache参数
安装完成后配置:
1834 [opcache]
1835 zend_extension=opcache.so
1837 opcache.enable=1
1843 opcache.memory_consumption=128
1846 opcache.interned_strings_buffer=8
1850 opcache.max_accelerated_files=4000
1868 opcache.revalidate_freq=60
1835 zend_extension=opcache.so
1837 opcache.enable=1
1843 opcache.memory_consumption=128
1846 opcache.interned_strings_buffer=8
1850 opcache.max_accelerated_files=4000
1868 opcache.revalidate_freq=60
配置详情参见:http://php.net/manual/zh/opcache.configuration.php
使用效果:
使用前:
使用后:
测试工具为xhprof
转载请注明:小Y » opcache使用及测试