Bug #80419 [Com]: opcache: free memory not reported as free

From: Date: Mon, 30 Nov 2020 20:51:51 +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-230748@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:         carsten_hammer at web dot de
 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:

Yeah, I realize that now.
But looking at the config I was under the impression that the opcache could be configured per pool
and that it was then shared between worker processes thereof. 
The pool config already had a memory_limit and opcache.file_cache overrides after all, so just
adding an opcache.memory_consumption override seemed logical.

For this be a common sense, you'd actually have to know about the scope of shared memory in
this context, which I freely admit I did not.


Previous Comments:
------------------------------------------------------------------------
[2020-11-30 18:46:29] rtrtrtrtrt at dfdfdfdf dot dfd

> 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

------------------------------------------------------------------------
[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.

------------------------------------------------------------------------


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


Thread (10 messages)

« previous php.bugs (#230748) next »