Nginx cache wired behavior

Alexander Pyhalov alp at rsu.ru
Mon Jun 20 20:18:52 MSD 2011


Hello.
I have the following problem:
When static cached file is changed, nginx returns it to client after 
very long timeout. Great delay can be seen after receiving all file 
content on the client (client receives all file data from server at 
20:03:01, sends ack, and then receives Fin packet at 20:04:00).

I don't see any related errors in error.log. How can I debug this issue?

Server config is the following:

server {
         listen   80; ## listen for ipv4
         server_name ...;
         access_log off;
         client_body_buffer_size 128k;

         open_file_cache max=2048 inactive=600s;
         open_file_cache_valid 2000s;
         open_file_cache_min_uses 1;
##      open_file_cache_errors on;

         location ~ /\.(ht|svn) {
                 deny  all;
         }

         location ~ \.(lib|inc|admin|handler|action|sql|log)$ {
                 deny  all;
         }

         location ~ /(crons|scripts|shared)/ {
                 deny all;
         }


         location ~ \.php$ {
#               limit_conn one 2;
                 include       fastcgi_params;
                 fastcgi_index       index.php;
                 fastcgi_param       SCRIPT_FILENAME 
/path/to/www$fastcgi_script_name;
                 fastcgi_buffer_size 64k;
#               fastcgi_buffer_size 4k;
                 fastcgi_buffers 32 256k;
#               fastcgi_buffers 1024 4k;
                  if ($uri !~ "^/images/") {
#                       fastcgi_pass 
unix:/var/run/fastcgi-mhouse-pool;
                         fastcgi_pass        mhouse_fastcgi;
                 }
         }

         location / {
                 root   /path/to/www;
                 index  index.php;
         }
}

$ uname -a
Linux hostname.provided.here 2.6.35-28-generic #50-Ubuntu SMP Fri Mar 18 
18:42:20 UTC 2011 x86_64 GNU/Linux

$ nginx -V
nginx version: nginx/0.7.67
TLS SNI support enabled
configure arguments: --conf-path=/etc/nginx/nginx.conf 
--error-log-path=/var/log/nginx/error.log 
--http-client-body-temp-path=/var/lib/nginx/body 
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi 
--http-log-path=/var/log/nginx/access.log 
--http-proxy-temp-path=/var/lib/nginx/proxy 
--lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid 
--with-debug --with-http_dav_module --with-http_flv_module 
--with-http_geoip_module --with-http_gzip_static_module 
--with-http_realip_module --with-http_stub_status_module 
--with-http_ssl_module --with-http_sub_module --with-ipv6 --with-mail 
--with-mail_ssl_module 
--add-module=/build/buildd/nginx-0.7.67/modules/nginx-upstream-fair



-- 
Best regards,
Alexander Pyhalov,
system administrator of Computer Center of Southern Federal University



More information about the nginx mailing list