Bug #75091 [Com]: The memory taken from opcache.interned_strings_buffer isn't refreshed
| From: | kimegede at gmail dot com | Date: | Mon, 20 Nov 2017 07:44:38 +0000 |
| Subject: | Bug #75091 [Com]: The memory taken from opcache.interned_strings_buffer isn't refreshed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-212629@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75091&edit=1
ID: 75091
Comment by: kimegede at gmail dot com
Reported by: j3mata at gmail dot com
Summary: The memory taken from
opcache.interned_strings_buffer isn't refreshed
Status: Open
Type: Bug
Package: opcache
Operating System: CentOS 6
PHP Version: 7.0.22
Block user comment: N
Private report: N
New Comment:
Running PHP 7.0.25 (+ Zend OPcache v7.0.25) on Centos 7.4.1708
Haven't yet figured out what the issue is, but with OPCache enabled, the applications will
crash, leading to "500 Internal Server Error".
Earlier on, I got Segfaults:
Nov 2 11:32:21 ip-172-31-27-62 kernel: php-fpm[21952]: segfault at 2f2a2020 ip 00007feb149f6faf sp
00007ffe8a547c68 error 4
Nov 2 11:32:21 ip-172-31-27-62 kernel: php-fpm[22276]: segfault at 2f2a2020 ip 00007feb149f6faf sp
00007ffe8a547c68 error 4
Nov 2 11:32:21 ip-172-31-27-62 kernel: in libc-2.17.so[7feb148ba000+1b8000]
Nov 2 11:09:04 ip-172-31-27-62 kernel: traps: php-fpm[123783] general protection ip:7feb176433b1
sp:7ffe8a548cc0 error:0 in php-fpm[7feb173e1000+3e8000]
Nov 2 11:09:04 ip-172-31-27-62 kernel: php-fpm[123430]: segfault at 2f2a2020 ip 00007feb149f6faf sp
00007ffe8a547c68 error 4 in libc-2.17.so[7feb148ba000+1b8000]
Nov 2 11:09:04 ip-172-31-27-62 kernel: traps: php-fpm[117106] general protection ip:7feb149f6faf
sp:7ffe8a547e98 error:0 in libc-2.17.so[7feb148ba000+1b8000]
Previous Comments:
------------------------------------------------------------------------
[2017-08-18 10:17:53] j3mata at gmail dot com
Description:
------------
Hello,
I have came accross this issue after we have recieved random complains for 500ISE errors, which are
solved after increasing opcache.interned_strings_buffer value.
Through series of tests, it seems that the memory set for opcache.interned_strings_buffer is filled
the first time the opcache cache files are created and then if the value set for
opcache.interned_strings_buffer is changed, the same amount of memory is requested as the first run.
Clearing up the opcache file_cache restarts the above described process.
This leads to unexpected behaviour:
* if the value is changed to smaller then the initial value -> most likely the site will not
load and will return various errors. It seems the cached files are loaded from the opcache code,
until the memory is filled ( set by the smaller value ) and just doesn't load the whole
application.
* if the value is changed to bigger then the initial value -> the opcache uses the same amount
of memory for interned_strings_buffer as the initial run.
*
This is produced in this environment:
* shared hosting, where the users applications are kept and loaded from /home/USER/
* opcache file_cache is stored in /home/USER/.opcache
* install a application which will take more then 3MB of the interned_strings_buffer memory.
Observe with opcache_get_status() the interned_strings_buffer usage
** Here I am using a default WP install, add some big plugings so it has enough modiles/classes
to load and somewhere in the code to print out opcache_get_status().
* Set interned_strings_buffer to 4MB and load the application - the interned_strings_buffer memory
usage would be somewhere between 3MB and 4MB.
* Set interned_strings_buffer to 2MB - it should break ( most often - not able to load some class
or 500ISE ).
* Clear /home/USER/.opcache/ files.
* Set interned_strings_buffer to 2MB and again observe its usage the same way as above - it uses
all 2MB ( with a few bytes left free ).
* Set interned_strings_buffer to 16MB and again observe its usage - it uses exactly the same amount
of memory as the first run ~ 2MB.
For the tests I was using opcache.memory_consumption with values 64/128/256.
Tested on PHP versions 7.0.22 and 7.1.8.
I am not sure this a bug in the opcache, but certainly doesn't seem to be expected behaviour.
Regards,
Ilian.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75091&edit=1