10s of dynamic load survived on a $5 box with a 1s microcache
Guide site got hit by a newsletter blast, 4k concurrent, PHP-FPM pegged at 100% and timing out.
Dropped in nginx fastcgi microcache, 1 second TTL:
— fastcgi_cache_path /dev/shm/nginxcache keys_zone=mc:50m inactive=60m;
— fastcgi_cache_valid 200 1s;
— fastcgi_cache_use_stale updating error timeout;
Even a 1s cache collapsed thousands of identical requests into one PHP hit. CPU fell from 100% to 22%, zero 502s. Logged-in users skip cache via cookie check.
Try it tonight.
Root Access Daily
@RootAccessDaily
10s of dynamic load survived on a $5 box with a 1s microcache
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.