解决Zend OPcache huge_code_pages: mmap(HUGETLB) failed: Cannot allocate memory报错
2018-10-27 11:33
4127 查看
前几日看到鸟哥介绍的 《让你的PHP7更快之Hugepage》, 于是想试试手给服务器加上,参照格式安装好扩展,调整好配置文件,然后重启php-fpm,结果启动一直报Zend OPcache huge_code_pages: mmap(HUGETLB) failed: Cannot allocate memory
看字面意思是无法分配内存?怎么会呢,机器内存还是很充足的,这点排查掉了。后面查找相关资料得到,是因为系统Hugepage不够,一般系统Hugepage是没有开启的,可以通过下面命令查看
cat /proc/meminfo | grep Huge HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB
HugePages_Total是0,加上就可以了,加上办法
sysctl vm.nr_hugepages=128 cat /proc/meminfo | grep Huge HugePages_Total: 128 HugePages_Free: 123 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB
已经加上了,重启php-fpm,问题解决。
参考文章:
让你的PHP7更快之Hugepage
https://www.geek-share.com/detail/2654715223.html
让PHP7达到最高性能的几个Tips
http://www.laruence.com/2015/12/04/3086.html
Linux下HugePage内存功能配置
相关文章推荐
- 解决Zend OPcache huge_code_pages: mmap(HUGETLB) fail
- nginx: [alert] mmap(MAP_ANON|MAP_SHARED, 536870912) failed (12: Cannot allocate memory)解决方法
- mysql:failed,启动失败,mmap failed-Cannot allocate memory for the buffer pool
- Mysql cannot allocate memory for the buffer pool 解决方法
- appium 遇到 xcodebuild failed with code 65 的解决方法
- 【linker command failed with exit code 1 (use -v to see invocation)】错误的解决办法
- 解决 linker command failed with exit code 1 (use -v to see invocation) 方法
- laravel composer安装的时候 报错proc_open(): fork failed - Cannot allocate memory
- 解决redis Can't save in background: fork: Cannot allocate memory
- 解决NodeJs gm模块报错{ [Error: Command failed: aaЧaaaa ] code: 4, signal: null }
- 解决 The Controls collection cannot be modified because the control contains code blocks (i.e. )问题
- 【已解决】Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-GFFuD_/ipython/
- Hexo:如何解决 FATAL Cannot read property 'code' of undefined
- Ubuntu mount error(12): Cannot allocate memory 的解决方法
- 解决Failed to allocate memory: 8
- “RegSvr32 failed with exit code 0x3”问题的解决办法
- 关于MongoDB在64位服务器上依然报 mmap failed with out of memory 错误的解决方法(附Mysql性能对比测试)
- clang: error: linker command failed with exit code 1 (use -v to see invocation)解决办法
- 解决 CoreData 报错 linker command failed with exit code 1 (use -v to see invocation)
- fork failed.: Cannot allocate memory