Anatol belski Continue reading...
one related to opcache.huge_code_pages but not sure if related to this centos 6 and transparent huge pages issue
Done My 4GB Linode Server takes 8 minutes to recompile PHP 7.0.1 :/ With 1,600+ current visitor as of XF and 300+ real time based on GA.
Code: Starting php-fpm [17-Dec-2015 15:46:37] NOTICE: PHP message: PHP Warning: Zend OPcache huge_code_pages: mmap(HUGETLB) failed: Cannot allocate memory (12) in Unknown on line 0
is that just a PHP 7.0.1 update and no changes to zendopcache.ini ? on centos 6.7 ? what output do you get for these cmds Code: cat /sys/kernel/mm/redhat_transparent_hugepage/enabled cat /etc/centminmod/php.d/zendopcache.ini
Tried to enable huge_code_pages so set Code: opcache.huge_code_pages=1 If I set it back to 0, everything works fine. Edit: yes CentOS 6.7.
what output do you get for these cmds Code: cat /sys/kernel/mm/redhat_transparent_hugepage/enabled cat /etc/centminmod/php.d/zendopcache.ini
Code: [root@localhost php.d]# cat /sys/kernel/mm/redhat_transparent_hugepage/enabled [always] madvise never [root@localhost php.d]# cat /etc/centminmod/php.d/zendopcache.ini zend_extension=opcache.so ;opcache.error_log=/var/log/php_opcache_error.log opcache.enable=1 opcache.memory_consumption=1024 opcache.interned_strings_buffer=8 opcache.max_wasted_percentage=5 opcache.max_accelerated_files=16000 ; http://php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq ; defaults to zend opcache checking every 180 seconds for PHP file changes ; set to zero to check every second if you are doing alot of frequent ; php file edits/developer work ; opcache.revalidate_freq=0 opcache.revalidate_freq=360 opcache.fast_shutdown=1 opcache.enable_cli=0 opcache.save_comments=1 opcache.enable_file_override=1 opcache.validate_timestamps=1 opcache.huge_code_pages=1
so it's enabled but still opcache.huge_code_pages=1 doesn't work, so probably still related to centos 6.x issues need someone with /sys/kernel/mm/redhat_transparent_hugepage/enabled set to always on CentOS 7. to try opcache.huge_code_pages=1 to confirm
Code: [root@localhost php.d]# cat /proc/meminfo MemTotal: 8059148 kB MemFree: 3650240 kB Buffers: 159136 kB Cached: 3035180 kB SwapCached: 0 kB Active: 2187224 kB Inactive: 1875976 kB Active(anon): 876132 kB Inactive(anon): 39088 kB Active(file): 1311092 kB Inactive(file): 1836888 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 4194300 kB SwapFree: 4194300 kB Dirty: 44 kB Writeback: 0 kB AnonPages: 868904 kB Mapped: 39184 kB Shmem: 46340 kB Slab: 264628 kB SReclaimable: 235900 kB SUnreclaim: 28728 kB KernelStack: 3216 kB PageTables: 7240 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 8223872 kB Committed_AS: 2721700 kB VmallocTotal: 34359738367 kB VmallocUsed: 32256 kB VmallocChunk: 34359612688 kB HardwareCorrupted: 0 kB AnonHugePages: 448512 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 8180 kB DirectMap2M: 8380416 kB
yeah not ideal @Ahmad looks like centos 6.7 might not configure any hugepages itself even if enabled transparent huge page support Code: cat /proc/meminfo | grep -i HugePage AnonHugePages: 178176 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB as you have over 3GB of free memory you can afford to say assign 80 x 2048KB (Hugepagesize) = 160MB of memory to huge pages via adding to /etc/sysctl.conf the option vm.nr_hugepages=80 (DO NOT do this if you don't have enough free memory or adjust as needed for your memory availability) Code: echo "vm.nr_hugepages=80" >> /etc/sysctl.conf sysctl -p doublecheck Code: cat /proc/meminfo | grep -i HugePage AnonHugePages: 178176 kB HugePages_Total: 80 HugePages_Free: 80 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB Looks like it's same for my virtualbox CentOS 7.1 build nr_hugepages isn't configured even if there is transparent huge pages support Code: cat /proc/meminfo | grep -i HugePage AnonHugePages: 98304 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB
thanks for confirmation, guess i need to come up with a detection routine and formula to dynamically allocate nr_hugepages number based on detected amount of free memory available on both centos 6.x and 7.x