Skip to main content

OPCache config in EA4

Comments

14 comments

  • roliboli
    Hi the settings are per modul and PHP version specific: /opt/cpanel/ea-php56/root/etc/php.d/10-opcache.ini /opt/cpanel/ea-php70/root/etc/php.d/10-opcache.ini But my problem is that OpCache is not working. I have the recommende configuration with php-mpm prefork. But the documentations says that the all cgi-handlers are not compatible with OpCache (PHP Options - EasyApache 4 - cPanel Documentation "Opcode caching programs are not compatible with the suPHP or CGI PHP handlers. The caching program either does not function, or functions incorrectly.") So after provisioning with extension OpCache the module is enabled. But there are only misses. Do you have the same problem? Regards
    0
  • cPanelMichael
    Hello, The "Warnings" section under the Opcache section on the following document explains some key considerations: PHP Options - EasyApache 4 - cPanel Documentation It notes: [LIST]
  • EasyApache 4 does not currently support any opcode cacher other than OPCache.
  • Opcode caching programs are not compatible with the suPHP or CGI PHP handlers. The caching program either does not function, or functions incorrectly.
  • The system does not automatically configure OPCache. If you do not manually configure OPCache after you install it, it will provide no benefits.
  • We strongly recommend the DSO PHP handler for the OPCache opcode cacher.
  • Do not install multiple PHP caching programs on the same system. Multiple opcode caching programs consume excessive memory and degrade system performance.
    Also, regarding the php.ini changes, ensure they are added to the following file for PHP 5.6:
    /opt/cpanel/ea-php56/root/etc/php.d/opcache.ini
    Thank you.
  • 0
  • Yukinarija
    Hi the settings are per modul and PHP version specific: /opt/cpanel/ea-php56/root/etc/php.d/10-opcache.ini /opt/cpanel/ea-php70/root/etc/php.d/10-opcache.ini But my problem is that OpCache is not working. I have the recommende configuration with php-mpm prefork. But the documentations says that the all cgi-handlers are not compatible with OpCache (not compatible with the suPHP or CGI PHP handlers. The caching program either does not function, or functions incorrectly.") So after provisioning with extension OpCache the module is enabled. But there are only misses. Do you have the same problem? Regards

    Hey roliboli, yep - same issue. But somehow with 7.0 and CGI it starts hitting - strange. I hope that it works with fCGI as well as with DSO PHP. For our needs we could even use DSO, so it's pretty okay.
    Hello, The "Warnings" section under the Opcache section on the following document explains some key considerations:
    0
  • roliboli
    Hi Michael So there is no possibility to have OpCache with php-fpm (prefork)? It makes no sense to activate OpCache because the apachebench shows slower values instead more speed. Both php7 and php56. Actually we have on another server EA3 with fcgid and OpCache which is much faster than the php-fpm. DSO is not possible for me because I need the process running under user rights. Regards
    0
  • Yukinarija
    Hey roli, They replied to me in an another thread saying that fCGI is not available until version 62 IIRC. Only DSO+OpCache is possible in EA4. Overall, as much as I like PHP7, if you can't use DSO (like I can't in one of our servers), need to revert back to EA3 then until 62 and fCGI.
    0
  • cPanelMichael
    So there is no possibility to have OpCache with php-fpm (prefork)? It makes no sense to activate OpCache because the apachebench shows slower values instead more speed. Both php7 and php56. Actually we have on another server EA3 with fcgid and OpCache which is much faster than the php-fpm.

    Hello, It's possible to use OPCache with PHP-FPM, yes. Regarding FastCGI, PHP-FPM is similar to FastCGI, but there are differences to how they are configured to work (e.g. PHP-FPM uses mod_proxy_fcgi as it's backend). Support for mod_fcgid in cPanel version 62 provides the same FastCGI handler that was offered in EasyApache 3. This is discussed under the comments section at: EasyApache 4 mod_fcgid Thank you.
    0
  • roliboli
    Hi Michael
    It's possible to use OPCache with PHP-FPM, yes.

    But in the documentation is writtten: "Opcode caching programs are not compatible with the suPHP or CGI PHP handlers". So in my point of view PHP-FPM is meant for "CGI PHP handlers". I installed mainly mod_mpm_prefork, mod_ruid2, php-fpm (EA4: Cpanel Default). Then OpCache can be enabled but it producess always misses and the performance is slower than without OpCache. Regards
    0
  • cPanelMichael
    Hello @roliboli, Could you elaborate a little more on your last response? Are you suggesting we update the PHP Options document to include support for PHP-FPM and Opcache? Thank you.
    0
  • roliboli
    I don't now if the documentation is correct. Because you say that PHP-FPM is working with OpCache. But with mod_mpm_prefork, mod_ruid2, php-fpm (default config) OpCache doesn't work correct (in my opinion). I think PHP-FPM uses the CGI Handler. All I want to have is a PHP-FPM configuration (not DSO) with working OpCache for better performance. Best regards
    0
  • cPanelMichael
    But with mod_mpm_prefork, mod_ruid2, php-fpm (default config) OpCache doesn't work correct

    Could you test with Mod_Ruid2 disabled and see if you notice similar results? Here's some alternatives for symlink protection if you need to disable Mod_Ruid2: EasyApache4 symlink race protection Thank you.
    0
  • roliboli
    I disabled Mod_Ruid2 and there are only misses in both PHP7 and PHP56. Do you have a EA4 configuration with working OpCache? But I need CGI because the process should be executed under the user. Regards
    0
  • cPanelMichael
    Hello @roliboli, Could you open a support ticket using the link in my signature so we can review your system's specific configuration and verify why OPcache isn't working? Thank you.
    0
  • Yukinarija
    Hey guys, Turns out I did not read the replies right, so if somebody was also confused -> OPCache config in EA4 I am now using PHP 7.0 with PHP-FPM, in the GUI 'CGI' is selected, phpinfo shows: FPM/FastCGI And Zend OpCache is actually working and being hit. File for config is available here: /opt/cpanel/ea-php70/root/etc/php.d/10-zend.ini So yeah, OpCache works like this. And PHP-FPM uses the mod_fcgid, rather than straight FCGID, but I am not sure how much worse that is? I'd love to compare when we get a proper FCGID. Maybe somebody could inform me? I am happy that I came back to check, I can now increase Zend limits.
    0
  • cPanelMichael
    I'd love to compare when we get a proper FCGID.

    Hello, You can find a recent update on it's availability under the comments section of the related feature request at: EasyApache 4 mod_fcgid Thank you.
    0

Please sign in to leave a comment.