• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Opcache & PHP-FPM Questions

Dec@de42

New Pleskian
Hello everyone,
I am currently trying to understand 2 things in Plesk, or web hosting in general:
Opcache in combination with
PHP-FPM and PHP-FPM Dedicated

(I know there are handlers for PHP-FPM Apache and nginx, but this is not relevant for my question, I guess)

I already found some threads about those topics here at the Plesk forum, like this one and this linked guide, but they are confusing me even more.

So, here is what I found out so far (or what, I believe, is correct. Please correct me if I'm wrong)
  1. PHP-FPM and Dedicated use the same technology, and FPM is currently recommended because it is a more advanced Fast-CGI handler (here)
  2. PHP-FPM Dedicated is more stable & faster because it spawns its process, but also needs slightly more resource than non-dedicated FPM
  3. Opcache values specified in the "Additional configuration directives" for Plans/Subscriptions using PHP-FPM dedicated should work because they are using their own PHP-Handler and therefore have a dedicated opcache memory:
1638819966585.png

If my assumptions above are correct, then my questions are:
  • How do I specify the opcache memory size for the non-dedicated PHP-FPM handlers? Is this php.ini or this 10-opcache file the correct one?
  • Are the non-dedicated ones sharing/using the same opcache memory pool?
    • If yes: Is there any way to make sure every non-dedicated PHP-FPM subscription is getting its chunk of memory, i.e. by specifying a memory limit in the Additional configuration directives?

Thanks in advance for your help!
 
Seems your topic got missed.
If my assumptions above are correct, then my questions are:
  • How do I specify the opcache memory size for the non-dedicated PHP-FPM handlers? Is this php.ini or this 10-opcache file the correct one?
In the php.ini of the corresponding PHP version you can adjust the opcache.memory_consumption value.

  • Are the non-dedicated ones sharing/using the same opcache memory pool?
    • If yes: Is there any way to make sure every non-dedicated PHP-FPM subscription is getting its chunk of memory, i.e. by specifying a memory limit in the Additional configuration directives?
Yes all non-dedicated PHP versions share the opcache memory pool. Thats why the opcache_get_status PHP function is disabled by default. Otherwise different users/customers can view each others opcache objects. There is however no way to distribute opcache memory between users.
 
You can tune it in the corresponding version of 10-opcache.ini ( globally for the sites using that version of PHP )

In those files yon can find the corresponding settings ( most of them commented out )
 
Back
Top