Score:0

PHP FPM crashes server

jp flag

I have a LAMP stack on a droplet with all the latest specs.

My PHP FPM settings:

pm.max_children = 45
pm.start_servers = 15
pm.min_spare_servers = 15
pm.max_spare_servers = 20

I have 4GB memory and 80GB droplet.

I get this warning in php log:

WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children; there are 12 idle, and 24 total children

First, my websites run super fast until I get a white screen.

I have tried different settings but I can't seem to hit the right numbers.

Thanks!

in flag
How much memory does each HTTP request consume? 15 servers x 45 children = 675 threads. That works out to about 5MB of dedicated memory each (many PHP-based sites rely heavily on shared memory, which allows a PHP process to "consume more"). If you're running something like Moodle or Joomla, the available memory will be exhausted rather quickly, then the server will spend a remarkable amount of time swapping to disk ... or killing processes in an effort to recover resources
newcat1000 avatar
jp flag
Hi, about 200MB. I just made PHP FPM restart automatically on failure and changed my settings to 45, 17, 17, 20. Thanks!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.