Add workers to PHP5.6 Pool

Discussion in 'ISPConfig 3 Priority Support' started by jpcyrenne, Aug 12, 2024.

  1. jpcyrenne

    jpcyrenne Member HowtoForge Supporter

    Good day,

    Ref : Server: (Ubuntu 20.04.5 LTS (Focal Fossa)) ISPConfig 3.2.9p1
    PS: I will probably update ISPConfig with there modifications...

    Thi is a bit out of scope for ISPConfig, and more a 'How to pimp up the Perfect Server', but I'd like to know if it's possible to add more workers in the PHP ini overides of a project (Option / Custom php.ini settings)?
    I don't see anything in the /etc/php/5.6/cgi/php.ini file? An it probably should be done here?

    Background:
    I have 2 applications running on the server (LAMP) with ISPConfig. A front end with PHP7.3 and a back end API on PHP5.6 both runnning in Fast-CGI mode.

    There are a few times a week the php5.6 API stops responding (for a minute or two), but ISPConfig answers during this time and so does the front end. I guess Apache and PHP7.3 are OK. Thant's why i'm suspecting a lack of workers on the API (PHP5.6) side. I understand this service does many calls of it's own to external API's and many processes are left waiting...

    - I will double de machine (EC2 to 4 vCPU and 16G Ram) and want to know if I can double the workers (pool) for the PHP5.6 API? At least add more. Could you recommend the best way to do this?
    - Also if I do this, should I add some Apache workers (max) int hte Apache overrides or config of the server? What would you recommend (in /etc/apache2/apache2.conf) ?

    As always, thatks ahead,

    JP
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Have you considered switching the site to php-fpm mode? In that mode, you can set the number of worker processes for php on the options tab.
     
  3. jpcyrenne

    jpcyrenne Member HowtoForge Supporter

    Till,

    So you kinda confirm there's not much more to do with Fast-CGI, right? PHP-FPM5 would be the recommended way to go.
    I guess I can do a test with the Staging environment with the developer on PHP-FPM5.6.

    What about Apache, should I grow it if I grow PHP-FPM? Wouldn't want to afect the rest of the sites (front end and ISPConfig)
    I found something on ServerFault that goes like this (with a mpm module) :
    • Something like /etc/httpd/conf.modules.d/10-worker.conf:
      <IfModule mpm_worker_module>
      ServerLimit 250
      StartServers 10
      MinSpareThreads 75
      MaxSpareThreads 250
      ThreadLimit 64
      ThreadsPerChild 32
      MaxClients 8000
      MaxRequestsPerChild 10000
      </IfModule>
    Obviously these values need to be tested in my environment, but, for example, something like 'StartServers' defaults to 3, if not configured, I believe.

    Would you recommend anything like that as an addon for the Prefect Setup and ISPConfig? I don't want to mess up the server and other versions of PHP. Maybe I don't need this mpm module and on a wrong track?

    Thanks,

    JP​
     
  4. jpcyrenne

    jpcyrenne Member HowtoForge Supporter

    I did some reading and I seem to understand that this can be tweaked in php-fpm:
    /etc/php/5.6/fpm/pool.d/www.conf

    I see many pm.* params I can set (ex: pm.max_children = 5, pm.start_servers = 2...)

    Thanks to your feedback, I think I have a plan.

    Thanks again,

    JP
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Change php mode from fastcgi to php-fpm in website settings in ISPConfig, then go to the options tab of the website, you can set php-fpm parameters there. Di not edit any config files, the file /etc/php/5.6/fpm/pool.d/www.conf is not for ISPConfig websites anyway, so do not alter that file.
     

Share This Page