opcache

Reading various guides for installing nextcloud led me to https://www.sharpwriting.net/project/nextcloud-on-freebsd/ where in the section on configuring php

4. Configure php.ini​


there is the following section which I haven't seen in any other guide. I have no idea about opcache and am wondering whether it gives me anything.

Code:
[opcache]
zend_extension=opcache
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=512
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=1
opcache.save_comments=1
 
OPCache caused me grief with mod_php, but I think you are using php_fpm.


Looks like it might have eventually been resolved:


YMMV.
 
Looks like it would be worth adding these parameters.
Not sure if opcache differs when used with nginx, but I never changed an opcache setting aside just enabling the module (it sped up pages all OSs default settings). Some recent PHP 8 release I think integrates opcache ( zend_extension = "opcache" on Windows started throwing a warning but removing that still had it loaded)

opcache.memory_consumption might be interesting though; 512 seems fine for me (several sites with individual php-fpm and 16G RAM), but I'd consider upping that if you have the resources.

https://www.php.net/manual/en/opcache.configuration.php mentions opcache.jit being disabled 8.4+ (not sure why; seems better enabled but I have more settings to look into now :p)
 
Back
Top