client keep alive support under HTTP/1.0

Valentin V. Bartenev ne at vbart.ru
Mon Mar 5 08:34:21 UTC 2012


On Monday 05 March 2012 07:55:41 dbanks wrote:
> Hi Valentin,
> 
> Thanks for your response.  We've asked the other company if they might
> try something other than ab for their testing, but so far they seem to
> want to keep using it.  As a result, we're stuck with supporting it.
> 
> From the testing that the other company has done, and from the testing
> that we've done to try to repeat their results, it does not appear that
> nginx is supporting keepalives on HTTP/1.0 requests.  We see the request
> header go out with keepalives requested, but the response header
> contains Connection: Close.
> 
> If nginx supports this by default, it implies that we have an
> incompatible config option.  keepalive_timeout is 600 for this virtual
> server (tried it at 30s, also - same result).  We aren't using any other
> keepalive configs.
> 
> Any suggestions as to where else we might look?
> 

You may enable debug log, and look carefully for what happens.
http://nginx.org/en/docs/debugging_log.html

I cannot reproduce with my "ab -k" and nginx:

Request:

2012/03/04 17:32:34 [debug] 6990#0: *2 http header: "Connection: Keep-Alive"
2012/03/04 17:32:34 [debug] 6990#0: *2 http header: "Host: localhost:8000"
2012/03/04 17:32:34 [debug] 6990#0: *2 http header: "User-Agent: 
ApacheBench/2.3"
2012/03/04 17:32:34 [debug] 6990#0: *2 http header: "Accept: */*"

Response:

2012/03/04 17:32:34 [debug] 6990#0: *2 HTTP/1.1 200 OK
Server: nginx/1.1.16
Date: Sun, 04 Mar 2012 13:32:34 GMT
Content-Type: text/html
Content-Length: 2440
Last-Modified: Mon, 27 Feb 2012 12:42:11 GMT
Connection: keep-alive
Accept-Ranges: bytes

and connection is really keep-alive and reusable.

My test.conf:

error_log  logs/error.log debug;

events {}

http {
    server {
        listen      8000;
        server_name localhost;

        location / {
            root ..;
        }
    }
}


 wbr, Valentin V. Bartenev



More information about the nginx mailing list