Size php-fpm so 1GB RAM doesn't crash
Most guides leave pm.max_children at default and the box dies under load. Do the math instead:
— Check one worker's real usage: ps --no-headers -o rss -C php-fpm8.3 | sort -n | tail -1 (say 60MB)
— Reserve ~400MB for nginx/mysql, leaves 600MB. 600 / 60 = 10 children max
— In your pool: pm = dynamic, pm.max_children = 10, pm.start_servers = 3, pm.max_spare_servers = 5
— pm.max_requests = 500 to recycle leaky workers
Now a traffic spike queues instead of OOM-killing the box. Try it tonight.
Root Access Daily
@RootAccessDaily
Size php-fpm so 1GB RAM doesn't crash
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.