So, today I was introduced to OPcache... One of the users run to the issue when SHM was overloaded and performance degraded. From php.ini configs and fpm pool.d configs I see that OPcache is not utilized. Is this something not recommended? Tasks: 1. Enable OPcache by default in all PHP versions; 2. Set opcache.file_cache to the users /var/www/user/opcache folder; 3. Set permissions to user:user /var/www/user/opcache and chmod 0755 /var/www/user/opcache Is this enough?
Opcache is normally enabled by default, and it caches in RAM, so it does not need a folder. So I wonder why you think that cache is not used. You can test it like this: Code: php -i | grep "opcache.enable" In the output you shall see this if its on: Code: opcache.enable => On => On For php-fpm, you can use a file with phpinfo() function inside.
It is used, but only in SHM mode. There is users with wordpress sites which gobles up default 128 MB RAM allotment, so as a backup file cache should be used.
Ok, so the opcache is on and is being used. You can try, to see if file caching gives any benefits, but especially for WordPress users, it's probably better to use one of the WordPress caches that caches the rendered pages as files instead of letting opcache write the parsed PHP code to a file.