Просмотр исходного кода

Optimize file cache performance

Alexandros Ioannides 9 лет назад
Родитель
Сommit
168fd81eaf
1 измененных файлов с 8 добавлено и 3 удалено
  1. 8 3
      install/ubuntu/16.04/nginx/nginx.conf

+ 8 - 3
install/ubuntu/16.04/nginx/nginx.conf

@@ -105,13 +105,13 @@ http {
     error_page          502 503 504  /error/50x.html;
 
 
-    # Cache
-    proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=512m;
+    # Cache settings
+    proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=1024m;
     proxy_cache_key "$host$request_uri $cookie_user";
     proxy_temp_path  /var/cache/nginx/temp;
     proxy_ignore_headers Expires Cache-Control;
     proxy_cache_use_stale error timeout invalid_header http_502;
-    proxy_cache_valid any 3d;
+    proxy_cache_valid any 1d;
 
     map $http_cookie $no_cache {
         default 0;
@@ -119,6 +119,11 @@ http {
         ~wordpress_logged_in 1;
     }
 
+    # File cache settings
+    open_file_cache          max=10000 inactive=30s;
+    open_file_cache_valid    60s;
+    open_file_cache_min_uses 2;
+    open_file_cache_errors   off;
 
     # Wildcard include
     include             /etc/nginx/conf.d/*.conf;