Why is My Webserver Hanging?!? (Spoiler: It was PHP-FPM)

preview_player
Показать описание
My webserver randomly hangs, kicking my websites offline. After some investigating, it turned out to be PHP-FPM, and its default settings. With multiple PHP websites, the 5 default children get used up quickly!

If you'd like to see more videos about my favorite webserver (Caddyserver), let me know in the comments!

NOTE: I know this video wasn't actually about my webserver at all... but the question still stands, lol!

#linux #php #caddyserver
Рекомендации по теме
Комментарии
Автор

Very useful info for anyone running PHP-FPM, whatever the web server may be. We’re running it through Apache2 and this is setting us on the right track. Thanks!

grillonbleu
Автор

Hey great stuff we would love to see Caddyserver videos. thanks for your informative video

rupeshshrestha
Автор

Thank you so much. I spent way too many hours that I am ashamed to disclose and tried all sorts of configs with magic calculations from the net. The tool you shared and the steps to calculate size and processes was just what I needed

B.A.D.O.
Автор

Thank you for the content! You helped me a lot with a challenge that only who maintain a big traffic website will face of, awesome. Greetings from Brazil 🤘

maicon
Автор

Hey Shawn good video love these real life examples and troubleshooting.

neorejdv
Автор

Thanks for this info.
I just want to say, I'm running a few websites of my VPS from Vultr. I'm running Apache, with PHP, and MySQL, and my entire VM only has 1GB of RAM and 1GB of SWAP.
If you have 12GB or RAM and you're having issues, I don't think the issue is needing more RAM.

DigitalMetal
Автор

You should use a fixed number of child processes in a production server. Killing and respawning processes has a performance hit. Should also have a max requests set to respawn to preventemory leaks

nunochaves
Автор

Great stuff, would love to see more caddy material perhaps setting it up from scratch?

yayow_p
Автор

i checked my fpm conf its default to 50 child-process. Do I still need to adjust them?

komismo
Автор

I have multiple php running should the the numbers be remain same for all the php-fpms.

wangchukdorji
Автор

Hi,

thanks for sharing.
my new settings based in aval ram;

pm.max_children = 201
pm.start_servers = 50
pm.min_spare_servers = 50
pm.max_spare_servers = 150
pm.max_request = 2000

After changed i have the same error, i thing the values are not set! I already restarted the php and server too.
The message shows the old value pm.max_children setting (5)!

WARNING: [pool librenms] server reached pm.max_children setting (5), consider raising it

What else do I need to do?
Thanks

DomingosVarela
Автор

++ caddy v Apache ; and thank you.

and this spesefic video totally relates to my past 4 hours.

CaseyCarnnia
Автор

php-fpm is a lovely thing. I once wrote a 3-page document for work detailing how you can `kill -USR2` an fpm poolrunner's PID to cause it to be like "yo shit ain't right" and reload that pool's config.

leeterthanyou
Автор

Lopez Margaret Rodriguez Donna White Mark

JeffreyLopez-mk