documentation icon indicating copy to clipboard operation
documentation copied to clipboard

(server tuning) Clarify opcache settings impact on occ maintenace:mode

Open joshtrichards opened this issue 2 years ago β€’ 6 comments

…and config.php

Clarify impact of messing with opcache.revalidate_freqand/or disabling revaliation completely (i.e. opcache.validate_timestamps = 0).

β˜‘οΈ Resolves

  • Fix nextcloud/server#37557
  • Fix nextcloud/server#38872

πŸ–ΌοΈ Screenshots

image

joshtrichards avatar Jun 18 '23 14:06 joshtrichards

I would probably phrase it differently, doing less changes but mostly add "and some occ commands like occ:maintenance:mode" after "config.php". But I am no native speaker and the change is factually correct. So I'll leave approval up to someone else, regarding whether it is good and understandable English πŸ™‚.

In any case, we want this in older NC version docs as well.

MichaIng avatar Jun 18 '23 18:06 MichaIng

/backport to stable27

MichaIng avatar Jun 18 '23 18:06 MichaIng

/backport to stable26

MichaIng avatar Jun 18 '23 18:06 MichaIng

Thanks for your pull request :+1:

We try to invalidate the cache when changing the configuration file.^1

Afaik opcache is different for cli/web and therefor maintenance:mode --off will not invalidate the cache for web requests. I guess we need a web controller to trigger a cache clear from cli for opcache web.

opcache.validate_timestamps = 0

I expect to run into the same issue (no changes without php-fpm restart) for

occ app:install, oc app:update, occ app:remove, occ system:config:set and any other occ command altering php files.

kesselb avatar Jun 18 '23 19:06 kesselb

Afaik opcache is different for cli/web and therefor maintenance:mode --off will not invalidate the cache for web requests.

Exactly, different PHP process (even different executable) means own OPcache. CLI should not have any OPcache at all, unless it has been manually explicitly enabled in PHP configs (not recommended). There is no way of accessing another PHP instance's OPcache, reasonably.

I guess we need a web controller to trigger a cache clear from cli for opcache web.

That would be great. But it needs to be somehow secured, of course no open web API. Some sort of flag in database or on filesystem wouldn't make sense either: If a flag needed to be checked on every web access/action, it would break the little performance benefit of disabling OPcache validation. So either there is a secure way to directly trigger it, or it better remains a documented limitation when disabling OPcache validation.

MichaIng avatar Jun 18 '23 20:06 MichaIng

Another related issue (not sure why I didn't link this originally): #9184

joshtrichards avatar Nov 01 '23 13:11 joshtrichards