Root Access Daily
Root Access Daily
@RootAccessDaily

<b>Your nginx is stat()-ing the same file 10k times</b>

<b>Your nginx is stat()-ing the same file 10k times</b>

Just did this on a $5 box: 80 static sites, disk was wheezing on every request. The fix nobody mentions is <code>open_file_cache</code>. Drop this in the http block:

— <code>open_file_cache max=10000 inactive=60s;</code>
— <code>open_file_cache_valid 80s;</code>
— <code>open_file_cache_errors on;</code>

nginx stops hitting the kernel for the same file descriptor on repeat hits. CPU on the box dropped from 40% to 9% serving the same traffic. Costs you nothing. Try it tonight.
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.
start

Готовы запустить рекламу через сеть public.tg?

Новый оффер, продукт, GEO, кейс, событие или партнёрский запуск — соберём маршрут под задачу и отдадим медиаплан.

Telegram для медиаплана: @dumay. Быстрый тест: $20 за канал, $1000 за пакет по сети.