(bug?)Timeout when proxy-pass 0 byte file

tOmasEn tomasen at gmail.com
Wed Sep 30 07:26:59 MSD 2009


here is my conf

http{
   ...
        proxy_buffer_size 4k;
        proxy_buffers 1024 4k;
        proxy_temp_path /data/nginx/proxy_temp ;
        proxy_cache_path  /data/nginx/proxy_cache  levels=1:2
keys_zone=cache1:1000m;
    ...
server{
    ...
   location ~* \.(ico|css|js|gif|jp?g|png|xsl)$ {
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
                      proxy_set_header Host $http_host;
                      proxy_redirect off;
                        proxy_pass http://61.129.66.75:80;
                        proxy_cache_key shtatic$request_uri;
                        proxy_cache cache1;
                        break;
        }
   ....
}

the initiall request when there isn't and cache, everything is ok. the
following request to same url will wait until timeout.

this is the debug log around the second request:

2009/09/30 10:53:57 [debug] 6733#0: event timer del: -1: 1254279237061
2009/09/30 10:53:57 [debug] 6733#0: http file cache expire
2009/09/30 10:53:57 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:53:57 [debug] 6733#0: http file cache size: 1
2009/09/30 10:53:57 [debug] 6733#0: event timer add: -1: 10000:1254279247061
2009/09/30 10:53:57 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:53:57 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:54:07 [debug] 6733#0: timer delta: 10000
2009/09/30 10:54:07 [debug] 6733#0: event timer del: -1: 1254279247061
2009/09/30 10:54:07 [debug] 6733#0: http file cache expire
2009/09/30 10:54:07 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:54:07 [debug] 6733#0: http file cache size: 1
2009/09/30 10:54:07 [debug] 6733#0: event timer add: -1: 10000:1254279257061
2009/09/30 10:54:07 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:54:07 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:54:15 [debug] 6732#0: timer delta: 38923
2009/09/30 10:54:15 [debug] 6732#0: posted events 0000000000000000
2009/09/30 10:54:15 [debug] 6732#0: worker cycle
2009/09/30 10:54:15 [debug] 6732#0: epoll timer: 1
2009/09/30 10:54:15 [debug] 6732#0: timer delta: 4
2009/09/30 10:54:15 [debug] 6732#0: *4 event timer del: 13: 1254279255991
2009/09/30 10:54:15 [debug] 6732#0: *4 http keepalive handler
2009/09/30 10:54:15 [debug] 6732#0: *4 close http connection: 13
2009/09/30 10:54:15 [debug] 6732#0: *4 free: 000000000BC58070
2009/09/30 10:54:15 [debug] 6732#0: *4 free: 0000000000000000
2009/09/30 10:54:15 [debug] 6732#0: *4 free: 000000000BB9B890, unused: 8
2009/09/30 10:54:15 [debug] 6732#0: *4 free: 000000000BB9BAE0, unused: 128
2009/09/30 10:54:15 [debug] 6732#0: posted events 0000000000000000
2009/09/30 10:54:15 [debug] 6732#0: worker cycle
2009/09/30 10:54:15 [debug] 6732#0: epoll timer: -1
2009/09/30 10:54:17 [debug] 6733#0: timer delta: 10001
2009/09/30 10:54:17 [debug] 6733#0: event timer del: -1: 1254279257061
2009/09/30 10:54:17 [debug] 6733#0: http file cache expire
2009/09/30 10:54:17 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:54:17 [debug] 6733#0: http file cache size: 1
2009/09/30 10:54:17 [debug] 6733#0: event timer add: -1: 10000:1254279267063
2009/09/30 10:54:17 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:54:17 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:54:27 [debug] 6733#0: timer delta: 10000
2009/09/30 10:54:27 [debug] 6733#0: event timer del: -1: 1254279267063
2009/09/30 10:54:27 [debug] 6733#0: http file cache expire
2009/09/30 10:54:27 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:54:27 [debug] 6733#0: http file cache size: 1
2009/09/30 10:54:27 [debug] 6733#0: event timer add: -1: 10000:1254279277063
2009/09/30 10:54:27 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:54:27 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:54:37 [debug] 6733#0: timer delta: 10001
2009/09/30 10:54:37 [debug] 6733#0: event timer del: -1: 1254279277063
2009/09/30 10:54:37 [debug] 6733#0: http file cache expire
2009/09/30 10:54:37 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:54:37 [debug] 6733#0: http file cache size: 1
2009/09/30 10:54:37 [debug] 6733#0: event timer add: -1: 10000:1254279287064
2009/09/30 10:54:37 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:54:37 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:54:47 [debug] 6733#0: timer delta: 10000
2009/09/30 10:54:47 [debug] 6733#0: event timer del: -1: 1254279287064
2009/09/30 10:54:47 [debug] 6733#0: http file cache expire
2009/09/30 10:54:47 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:54:47 [debug] 6733#0: http file cache size: 1
2009/09/30 10:54:47 [debug] 6733#0: event timer add: -1: 10000:1254279297064
2009/09/30 10:54:47 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:54:47 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:54:57 [debug] 6733#0: timer delta: 10000
2009/09/30 10:54:57 [debug] 6733#0: event timer del: -1: 1254279297064
2009/09/30 10:54:57 [debug] 6733#0: http file cache expire
2009/09/30 10:54:57 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:54:57 [debug] 6733#0: http file cache size: 1
2009/09/30 10:54:57 [debug] 6733#0: event timer add: -1: 10000:1254279307064
2009/09/30 10:54:57 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:54:57 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:55:07 [debug] 6733#0: timer delta: 10002
2009/09/30 10:55:07 [debug] 6733#0: event timer del: -1: 1254279307064
2009/09/30 10:55:07 [debug] 6733#0: http file cache expire
2009/09/30 10:55:07 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:55:07 [debug] 6733#0: http file cache size: 1
2009/09/30 10:55:07 [debug] 6733#0: event timer add: -1: 10000:1254279317066
2009/09/30 10:55:07 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:55:07 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:55:17 [debug] 6733#0: timer delta: 10000
2009/09/30 10:55:17 [debug] 6733#0: event timer del: -1: 1254279317066
2009/09/30 10:55:17 [debug] 6733#0: http file cache expire
2009/09/30 10:55:17 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:55:17 [debug] 6733#0: http file cache size: 1
2009/09/30 10:55:17 [debug] 6733#0: event timer add: -1: 10000:1254279327066
2009/09/30 10:55:17 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:55:17 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:55:27 [debug] 6733#0: timer delta: 10001
2009/09/30 10:55:27 [debug] 6733#0: event timer del: -1: 1254279327066
2009/09/30 10:55:27 [debug] 6733#0: http file cache expire
2009/09/30 10:55:27 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:55:27 [debug] 6733#0: http file cache size: 1
2009/09/30 10:55:27 [debug] 6733#0: event timer add: -1: 10000:1254279337067
2009/09/30 10:55:27 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:55:27 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:55:37 [debug] 6733#0: timer delta: 10000
2009/09/30 10:55:37 [debug] 6733#0: event timer del: -1: 1254279337067
2009/09/30 10:55:37 [debug] 6733#0: http file cache expire
2009/09/30 10:55:37 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:55:37 [debug] 6733#0: http file cache size: 1
2009/09/30 10:55:37 [debug] 6733#0: event timer add: -1: 10000:1254279347067
2009/09/30 10:55:37 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:55:37 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:55:47 [debug] 6733#0: timer delta: 10001
2009/09/30 10:55:47 [debug] 6733#0: event timer del: -1: 1254279347067
2009/09/30 10:55:47 [debug] 6733#0: http file cache expire
2009/09/30 10:55:47 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:55:47 [debug] 6733#0: http file cache size: 1
2009/09/30 10:55:47 [debug] 6733#0: event timer add: -1: 10000:1254279357068
2009/09/30 10:55:47 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:55:47 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:55:57 [debug] 6733#0: timer delta: 10001
2009/09/30 10:55:57 [debug] 6733#0: event timer del: -1: 1254279357068
2009/09/30 10:55:57 [debug] 6733#0: http file cache expire
2009/09/30 10:55:57 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:55:57 [debug] 6733#0: http file cache size: 1
2009/09/30 10:55:57 [debug] 6733#0: event timer add: -1: 10000:1254279367069
2009/09/30 10:55:57 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:55:57 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:56:07 [debug] 6733#0: timer delta: 10000
2009/09/30 10:56:07 [debug] 6733#0: event timer del: -1: 1254279367069
2009/09/30 10:56:07 [debug] 6733#0: http file cache expire
2009/09/30 10:56:07 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:56:07 [debug] 6733#0: http file cache size: 1
2009/09/30 10:56:07 [debug] 6733#0: event timer add: -1: 10000:1254279377069
2009/09/30 10:56:07 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:56:07 [debug] 6733#0: epoll timer: 10000
2009/09/30 10:56:17 [debug] 6733#0: timer delta: 10001
2009/09/30 10:56:17 [debug] 6733#0: event timer del: -1: 1254279377069
2009/09/30 10:56:17 [debug] 6733#0: http file cache expire
2009/09/30 10:56:17 [debug] 6733#0: malloc: 000000000BB9B890:62
2009/09/30 10:56:17 [debug] 6733#0: http file cache size: 1
2009/09/30 10:56:17 [debug] 6733#0: event timer add: -1: 10000:1254279387070
2009/09/30 10:56:17 [debug] 6733#0: posted events 0000000000000000
2009/09/30 10:56:17 [debug] 6733#0: epoll timer: 10000

and -V output:
--with-http_ssl_module --with-md5-asm --with-sha1-asm
--with-http_xslt_module --add-module=/home/nginx_uploadprogress_module
--with-debug

On Tue, Sep 29, 2009 at 10:48 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Tue, Sep 29, 2009 at 10:08:51PM +0800, tOmasEn wrote:
>
> > I been expirencing very slow page load when use nginx as frontend(with
> > proxy_pass) for a while.
> >
> > After some test and debug, i found that it always timeout on response
> > of 0 byte file.
> >
> > So i think there might be a bug when nginx running on proxy mode and
> > serving 0 byte files. The frontend will consider there should be more
> > data and wait until timeout or something like this.
>
> Could you please provide nginx -V output and debug log?
>
> Maxim Dounin
>
> >
> > Btw. Nginx is great. Thanks
> >
> > tomasen
> >
> > --
> > 从我的移动设备发送
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090930/d0b2c653/attachment.html>


More information about the nginx mailing list