Bug #75579 [Com]: All Interned Strings Free memory used and PHP crashes

From: Date: Wed, 29 Nov 2017 10:54:26 +0000
Subject: Bug #75579 [Com]: All Interned Strings Free memory used and PHP crashes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212797@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75579&edit=1 ID: 75579 Comment by: spam2 at rhsoft dot net Reported by: post at minhost dot no Summary: All Interned Strings Free memory used and PHP crashes Status: Open Type: Bug Package: opcache Operating System: CentOS 7.4 PHP Version: 7.1.12 Block user comment: N Private report: N New Comment: it helps you in the way that your server no longer crashs and you can assume that with 7.2/7.3 you will need higher values - most of the performance improvements happen in the opcache area it depends heavily on the numer of scripts called due runtime how high that values need to be - on our mainserver with 8000 scripts avg cached anything below 256/8 don't work proper at all and when you edit a file it's opcached version won't be reused at all because of "OPCache allocates one segment of shared memory when PHP starts, once for all, and never frees it nor fragments it" which is a design decision in favour of performance https://git.php.net/?p=php-src.git&a=search&h=HEAD&st=commit&s=interned Previous Comments: ------------------------------------------------------------------------ [2017-11-29 10:47:27] post at minhost dot no @spam2 at rhsoft dot net: And how does that information help me? All I know is that on both my production servers, when upgrading from PHP 7.1.11 to 7.1.12, on both servers PHP sites start crashing. When downgrading to PHP 7.1.11, everything works fine again. As sait previous, I suspect that opcache.interned_strings_buffer is the cause (but it might be something else), because on PHP 7.1.12 Interned Strings Free memory is all used up with nothing left like this: Interned Strings Used memory 4194288 Interned Strings Free memory 16 But when I downgrade to PHP 7.1.11, there is always plenty Interned Strings Free memory left (and PHP sites works without going down). But the only thing I know for sure, is that there is a change in PHP 7.1.12 that cause PHP sites to go down. ------------------------------------------------------------------------ [2017-11-29 10:40:31] spam2 at rhsoft dot net opcache.memory_consumption=64 opcache.interned_strings_buffer=8 http://blog.jpauli.tech/2015/03/05/opcache.html OPCache allocates one segment of shared memory when PHP starts, once for all, and never frees it nor fragments it ------------------------------------------------------------------------ [2017-11-29 10:31:34] post at minhost dot no Still waiting hoping someone could look into this. Currently I am not able to upgrade from PHP 7.1.11 because of this, as it causes all PHP sites to go down. Also when looking at the changelog for PHP 7.1.12 http://www.php.net/ChangeLog-7.php#7.1.12 it has this bugfix for opcache: "Fixed bug #75373 (Warning Internal error: wrong size calculation)." However the bug was reported for PHP 7.2.x, so maybe it does not apply to PHP 7.1.x? Could it be this fix that cause the new bug I experience?: https://bugs.php.net/bug.php?id=75373 ------------------------------------------------------------------------ [2017-11-28 08:28:50] post at minhost dot no If it helps, here is my opcache settings (please note this is servers with 128 GB RAM): opcache.memory_consumption=32768 opcache.interned_strings_buffer=4 opcache.max_accelerated_files=1000000 opcache.revalidate_freq=0 opcache.validate_timestamps=1 opcache.fast_shutdown=1 opcache.enable_cli=0 opcache.validate_permission=1 opcache.validate_root=1 opcache.use_cwd=1 opcache.revalidate_path=1 opcache.enable_file_override=1 opcache.file_cache=/var/www/tmp/.opcache opcache.file_cache_only=0 opcache.max_wasted_percentage=10 ------------------------------------------------------------------------ [2017-11-27 10:32:02] post at minhost dot no Description: ------------ We are running PHP-FPM with OPCache. The servers are shared hosting servers with many WordPress sites. After upgrading from PHP 7.1.11 to PHP 7.1.12, several PHP sites started to crash, and after a while, they was all down. When downgrading to PHP 7.1.11, all works correct again. It seems to be opcache interned_strings_buffer, that is the cause. For example when still running PHP 7.1.11 it looks like this in a PHP info page: Interned Strings Used memory 369608 Interned Strings Free memory 3824696 After upgrading to PHP 7.1.12 it looks like this (and PHP sites stops working): Interned Strings Used memory 4194272 Interned Strings Free memory 32 I have not tested this on PHP 7.0.26, but I suspect the problem is the same on that version. Conclusion: So, after upgrade toi PHP 7.1.12, ALL available "Interned Strings Free memory" is used, and PHP sites start going down. Downgrading to PHP 7.1.11 solves the problem. In apache error log for the domains, I had lines like this: Sun Nov 26 12:00:53.161278 2017] [proxy_fcgi:error] [pid 25870:tid 139679914243840] [client 176.74.214.18:8405] AH01067: Failed to read FastCGI header [Sun Nov 26 12:00:53.161304 2017] [proxy_fcgi:error] [pid 25870:tid 139679914243840] (104)Connection reset by peer: [client 176.74.214.18:8405] AH01075: Error dispatching request to : In php-fpm.log I had lines like this: [26-Nov-2017 11:52:04] NOTICE: [pool USERNAME] child 25329 started [26-Nov-2017 11:52:04] WARNING: [pool USERNAME] child 24302 exited on signal 11 (SIGSEGV) after 1.864571 seconds from start ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75579&edit=1

« previous php.bugs (#212797) next »