<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.
Root Access Daily
@RootAccessDaily
<b>Your nginx is stat()-ing the same file 10k times</b>
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.