9951 explained code solutions for 126 technologies


nginxUsing open_file_cache to optimize file access


server {
  open_file_cache max=100000 inactive=30m;
  open_file_cache_valid 5m;
  open_file_cache_min_uses 2;
  open_file_cache_errors on;
}ctrl + c
server {

virtual server configuration block

max=100000

cache up to 100000 file descriptors

inactive=30m

if file is accessed 2 times within 30 minutes, we will cache it's descriptor

open_file_cache_valid

period of time to check if cached file is updated

open_file_cache_min_uses

min number of times file is accessed within 30 minutes (inactive param) to cache it's descriptor

open_file_cache_errors

also cache errors like absent file or access denied