The Monitoring Dashboard provides an overview of the caches usage and hit-rate evolution over time for PHP applications:
The hit rate is the number of cache hits divided by the total number of memory requests over a given time interval.
The cache usage is the percentage of a specific cache memory currently allocated.
OPcache is a PHP extension that improves application performance by storing precompiled script, opcodes, in shared memory. It removes the need to load, parse and compile PHP files on every request.
The opcache.memory_consumption ini setting defines the size of the shared memory storage used by this cache.
Interned strings are a memory optimization added in PHP 5.4. PHP stores
immutable strings (a
char *) into a special buffer to be able to reuse its
pointer for all occurrences of the same string.
Blackfire recommends that the interned strings buffer does not represent more than 85% of the allocated memory.
This setting can be adjusted using the opcache.interned_strings_buffer.
ini setting configures the maximum number of files that can be cached. Complex
applications involve a lot of different PHP files, so it’s recommended to
increase the default value of
opcache.max_accelerated_files in production.
The realpath() function
returns the absolute path for any given relative file path. This conversion takes
a non-negligible time because it performs some filesystem calls. That’s why PHP
caches the results of
realpath() calls and their associated
stat() calls. The
ini setting defines the size of this cache.