i run nc 12.0.2 on debian 9.1 with apache, mariadb and php7 with opcache.
even though opcache is up and running with the configured params according to phpinfo() i receive warnings on the admin-page about it being configured wrong.
when setting it up i found out that this debian release does not configure it via /etc/php/7.0/*/php.ini (which the admin-page seems to read) but (exclusively) via /etc/php/7.0/mods-available/opcache.ini
i tested some settings and now use the following:
zend_extension=opcache.so
opcache.enable=1
opcache.enable_cli=1
opcache.max_accelerated_files=7963
opcache.fast_shutdown=0
opcache.memory_consumption=512
opcache.interned_strings_buffer=32
opcache.revalidate_freq=60
opcache.log_verbosity_level=1
; 0 = fatal; 1 = error, 2 = warning; 3 = info 4 = debug
opcache.error_log=/tmp/opc.log
; empty for STDERR (webserver log)
opcache.use_cwd=1
;opcache.save_comments=0
;opcache.load_comments=0
;opcache.file_cache=/tmp/op-tmp/
i looked up some values on php.net and changed some because the server has enough memory and cpu-cores to be able to handle this.
i ask the devs and others to share their views or comment on these settings.
1.
zend_extension=opcache.so
opcache.enable=1
opcache.enable_cli=1
all this has to be enabled for opache to work with apache and cli (occ, …)
2.
opcache.max_accelerated_files=7963
the nc-doc and warning suggest a value of 10.000 but php.net states: “The actual value used will be the first number in the set of prime numbers { 223, 463, 983, 1979, 3907, 7963, 16229, 32531, 65407, 130987 } that is greater than or equal to the configured value.” http://php.net/manual/en/opcache.configuration.php#ini.opcache.max-accelerated-files so 10.000 would actually set 16229. To me 7963 cached scripts seem enough for my nc-installation.
3.
opcache.fast_shutdown=0
settting this to on could lead to segfaults (i read in several places, but not on php.net)
4.
opcache.memory_consumption=512
opcache.interned_strings_buffer=32
i set this high in hope of a performance gain and because the box has enough memory
5.
opcache.revalidate_freq=60
(opcache.validate_timestamps is enabled by default)
how often to check (in seconds) if (cached) scripts (or rather, their timestamps) were changed in the filesystem. Default is 0 and means on every request: “0 will result in OPcache checking for updates on every request.” (http://php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq) i guess this only happens on an nc-update or if you change/write php-scripts yourself, so one minute seems sufficient for my needs. But in these cases i have to restart the webserver manually.
6.
opcache.log_verbosity_level=1
; 0 = fatal; 1 = error, 2 = warning; 3 = info 4 = debug
opcache.error_log=/tmp/opc.log
; empty for STDERR (webserver log)
the logging-stuff is just for my personal taste, it can help when debugging.
7.
opcache.use_cwd=1
appends the CWD to a script so that no mess ensues when there are scripts with the same basename in different dirs. i checked with
find /var/www/NC-WEBDIR -type f -iname “*.php” -exec basename {} ; | sort
and was certain this has to be set.
8.
;opcache.save_comments=0
;opcache.load_comments=0
load/save comments from php-code, enabled by default.
i was hoping for some performance-gains but setting this to on (1) caused nc not to run anymore at all. (the error-msg was very clear, though)
9.
;opcache.file_cache=/tmp/op-tmp/
i had hoped to improve performance by doing some file-caching but no files showed up in this dir and there was a noticeable performance loss.
maybe the code for the admin-warning (which i do not really mind if these settings are OK) and the documentation could be updated to include this stuff for debian 9.1.