Project

General

Profile

Actions

Bug #1338

closed

Very slow 304 responses, introduced in 1949.

Added by zlib over 16 years ago. Updated over 15 years ago.

Status:
Fixed
Priority:
High
Category:
core
Target version:
ASK QUESTIONS IN Forums:

Description

Hi,

I just upgraded from change-set 1857 to 1981 to discover images were taking a very long time to load.

These images were going through my mod_proxy_core setup. They appear to load quickly if the browser does not already have them cached, however when a 304 response is sent from the server, that's when it goes slow.

I also noticed that the log file shows 5 bytes being sent with the 304 response whereas with change-set 1857, zero byes are sent with the request.

This only occurs with images sent through mod_proxy_core. Direct requests (bypass proxy) work just fine so I assume the problem is definitely occurring at mod_proxy_core.

Thanks.


Files

lighttpd.trace (14.5 KB) lighttpd.trace zlib, 2007-09-09 10:01
lighttpd.2.trace (13.1 KB) lighttpd.2.trace More clear zlib, 2007-09-09 14:31
Actions #1

Updated by jan over 16 years ago

Please attach a strace (see wiki -> how to report a bug) showing the behaviour.

Actions #2

Updated by zlib over 16 years ago

I have attached a strace of me requesting the file /css/style.css?2 which takes about 5 seconds to load.

As this is running on my development machine, I have lighty configured to run as serveral servers in one by the use of $SERVERsocket. So when proxy requests come in, its actually serving from the same server process.

Actions #3

Updated by zlib over 16 years ago

I've now broken up my setup into separate processes so lighty isn't running everything in one go. Hopefully this is has given you a more clear strace.

From watching the strace as I request the file, the following seems to happen:

- Client request /img/logo1.gif
- Lighty forwards request through mod_proxy_core to another server
- That server immediately responds with 304 status
- Lighty does nothing for 4 seconds before returning 304 to the client

Thanks.

Actions #4

Updated by zlib over 16 years ago

I've done some testing and found the problem to occur after the changes made in changeset 1949.

When requesting a file through my mod_proxy_core setup an additional header is returned, "Transfer-Encoding: chunked" along with the request hanging for about 5 seconds.

When requesting a file directly from the backend server and not via the proxy, it is returned instantly without the "Transfer-Encoding: chunked" header.

'''Here is the problem occuring after changeset [http://trac.lighttpd.net/trac/changeset/1949 1949] and requesting via the load balanced proxy (bug version)'''


curl -v -H "If-Modified-Since: Sun, 01 Jan 2036 00:00:02 GMT" http://alpha.mingleville.com/robots.txt
* About to connect() to alpha.mingleville.com port 80
*   Trying 10.0.0.31... * connected
* Connected to alpha.mingleville.com (10.0.0.31) port 80
> GET /robots.txt HTTP/1.1
User-Agent: curl/7.12.1 (i686-redhat-linux-gnu) libcurl/7.12.1 OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6
Host: alpha.mingleville.com
Pragma: no-cache
Accept: */*
If-Modified-Since: Sun, 01 Jan 2036 00:00:02 GMT

< HTTP/1.1 304 Not Modified
< Content-Type: text/plain
< ETag: "61981870" 
< Accept-Ranges: bytes
< Last-Modified: Fri, 09 Nov 2007 12:00:38 GMT
< Date: Fri, 09 Nov 2007 14:48:49 GMT
< Server: lighttpd
< Transfer-Encoding: chunked
* Connection #0 to host alpha.mingleville.com left intact
* Closing connection #0

'''Here is the output when using changeset 1948 or 2019 with the block of code removed from response.c (working version)'''


curl -v -H "If-Modified-Since: Sun, 01 Jan 2036 00:00:02 GMT" http://alpha.mingleville.com/robots.txt
* About to connect() to alpha.mingleville.com port 80
*   Trying 10.0.0.31... * connected
* Connected to alpha.mingleville.com (10.0.0.31) port 80
> GET /robots.txt HTTP/1.1
User-Agent: curl/7.12.1 (i686-redhat-linux-gnu) libcurl/7.12.1 OpenSSL/0.9.7a zlib/1.2.1.2 libidn/0.5.6
Host: alpha.mingleville.com
Pragma: no-cache
Accept: */*
If-Modified-Since: Sun, 01 Jan 2036 00:00:02 GMT

< HTTP/1.1 304 Not Modified
< Content-Type: text/plain
< ETag: "61981870" 
< Accept-Ranges: bytes
< Last-Modified: Fri, 09 Nov 2007 12:00:38 GMT
< Date: Fri, 09 Nov 2007 14:23:11 GMT
< Server: lighttpd
< Content-Length: 0
* Connection #0 to host alpha.mingleville.com left intact
* Closing connection #0
Actions #5

Updated by stepancheg about 16 years ago

Actions #6

Updated by stbuehler over 15 years ago

  • Status changed from New to Fixed
  • Resolution set to duplicate
Actions

Also available in: Atom