Bug #80419 [Com]: opcache: free memory not reported as free
| From: | rtrtrtrtrt at dfdfdfdf dot dfd | Date: | Mon, 30 Nov 2020 18:46:29 +0000 |
| Subject: | Bug #80419 [Com]: opcache: free memory not reported as free | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230743@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80419&edit=1
ID: 80419
Comment by: rtrtrtrtrt at dfdfdfdf dot dfd
Reported by: carsten_hammer at web dot de
Summary: opcache: free memory not reported as free
Status: Open
Type: Bug
Package: opcache
Operating System: Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
> I'm unlikely to be the last one to think that
> you could override any php.ini setting in the
> fpm pool config
something si common sense, of course you can override "session.gc_maxlifetime" as example
even per directory, but it won#t help you to increase it when it's using the same directory and
"session.gc_probability" from a script with a lower value hits
the same for *shared memory* segments
Previous Comments:
------------------------------------------------------------------------
[2020-11-30 18:36:56] carsten_hammer at web dot de
Please put some info in the logs, if you decide to ignore certain external settings.
I'd hate to waste time trying to find a mistake in a config that gets silently ignored.
I also think that a remark in the documentation would be good.
This applies all php versions I've tested, 5.6-8.0, and I'm unlikely to be the last one to
think that you could override any php.ini setting in the fpm pool config.
------------------------------------------------------------------------
[2020-11-30 15:51:11] cmb@php.net
Not sure what to do here. On Windows, the situation is even
worse, since one could change INI settings for future FCGI
processes in php.ini. Still, likely a documentation issue.
------------------------------------------------------------------------
[2020-11-30 14:11:58] nikic@php.net
We should probably make setting of opcache.memory_consumption (and certain other settings) fail if
opcache is already started up. That way it would at least be obvious from phpinfo output that the
value did not change.
------------------------------------------------------------------------
[2020-11-27 14:56:24] carsten_hammer at web dot de
Yep, that seems to be it.
I've been setting the opcache.memory_consumption in an external opcache.ini as well as the fpm
pool config but not in the php.ini itself.
Tried it just now, and everything is reported correctly.
So, the takeaway is: don't try to set opcache.memory_consumption outside of the php.ini.
------------------------------------------------------------------------
[2020-11-27 12:06:52] nikic@php.net
Can't reproduce this on cli at least, free memory changes as memory_consumption changes.
First guess is that opcache.memory_consumption gets set in a place that still allows setting
PHP_INI_SYSTEM settings, but after opcache has already started up and the shared memory segment has
been allocated (this would also be consistent with the negative "used memory" you see in
one case, as that is calculated from the value of opcache.memory_consumption and the free and wasted
memory).
Which mechanism do you use to set opcache.memory_consumption? Is it anything other than a
system-wide php.ini file?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=80419
--
Edit this bug report at https://bugs.php.net/bug.php?id=80419&edit=1