Opcache Cache Keys running low

The Opcache extension caches the bytecode that PHP scripts are compiled into between requests. This significantly increases the performance of executing a PHP script.

The cache is sized using the PHP.ini opcache.max_accelerated_files setting.

It defines the maximum number of keys (and therefore scripts) in the OPcache hash table. 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, 262237, 524521, 1048793 } that is greater than or equal to the configured value.

When your application executes more PHP files than this number, then not all are cached and need to be compiled every time they are run. This can seriously hurt performance.

The solution to Opcache cache keys running low is to increase opcache.max_accelerated_files.

Still need help? Email [email protected]