modify PHP-FPM config customization

taker18

Verified User
Joined
Oct 18, 2021
Messages
149
Location
USA
I have 64G ram Server 8 core, but my but i have one of my site is very large and heavy, and all the times the admin site is extremely sluggish

this is my PHP-FPM config customization

./data/users/admin/php/php-fpm83.conf​


  1. [admin]
  2. user = $pool
  3. group = $pool
  4. listen = /usr/local/php83/sockets/$pool.sock
  5. listen.owner = $pool
  6. listen.group = apache
  7. listen.mode = 660
  8. pm = ondemand
  9. pm.max_children = 10
  10. pm.process_idle_timeout = 20
  11. pm.max_requests = 500


    Now I am convinced that I shouldn't switch pm = Ondemand to Dynamic, it should stay the same as Ondemand ok fine.
    but what about the rest

    pm.max_children = 10
    pm.process_idle_timeout = 20
    pm.max_requests = 500

    in fact some recommendation to add
    pm.max_children = 60
    pm.start_servers = 6
    pm.min_spare_servers = 4
    pm.max_spare_servers = 10


    any recommendation I want to change pm.max_children = 60 (increase it more than the default 10)
    Thank you
 
this is my Top

Code:
Top:
Tasks:
CPU(s):
KiB Mem:
KiB Swap:
21:16:48 up 251 days, 13:55, 0 users, load average: 0.32, 0.37, 0.36
320 total, 2 running, 318 sleeping, 0 stopped, 0 zombie
0.0 us, 0.4 sy, 0.0 ni, 99.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
63707.6 total, 1821.3 free, 3795.3 used, 58809.0 buff/cache
32735.0 total, 32477.5 free, 257.5 used. 59912.3 avail Mem
 
the admin site is extremely sluggish

That can be caused by a bunch of reasons. You might enable slow logs in PHP-FPM and see what is causing issues. Common reasons:

1. too slow SQL queries
2. requests to remote services, sites
3. operations with images (re-sizing, converting, etc)
 
Back
Top