Bug#509116: apache2: mod_deflate with mod_fastcgi gives wrong content-length header
Package: apache2.2-common
Version: 2.2.9-10+lenny1
Severity: normal
On upgrading from Etch to Lenny I got exceeding slow response on some FastCGI servers.
It was identified that the line:
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/json application/x-javascript
which adds the "deflate" filter is the culprit.
On inspection with "curl":
curl -D h1 http://simon.example.com/ >b1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 33180 100 33180 0 0 389k 0 --:--:-- --:--:-- --:--:-- 826k
curl --compressed -D h2 http://simon.example.com/ >b2
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
25 33180 25 8612 0 0 572 0 0:00:58 0:00:15 0:00:43 0
curl: (18) transfer closed with 24568 bytes remaining to read
b1 and b2 are identical.
The "content-length" header in h2 was still 33180, where as I'd expect this page to compress effectively.
So the slow response is the web browser timing out, but finding all the data it needs is already in memory.
Likely cause is bad interaction with mod_fastcgid, which we are using here to deploy a Catalyst application, as the content is dynamic in nature.
I'm not an expert in these things.
This combination of mod_fastcgi and mod_deflate was broken in Sarge,
but it resulted in the content being sent without compression, where as here the result is simply broken HTTP response, because it is being compressed, but the content-length header is wrong.
I see old reports of similar problems in Google.
e.g. http://archives.devshed.com/forums/dsm-125/apache-2-mod-deflate-mod-fastcgi-1284864.html
Shall go try mod_fcgid.
-- Package-specific info:
List of /etc/apache2/mods-enabled/*.load:
actions alias auth_basic auth_digest authn_file authz_default
authz_groupfile authz_host authz_user autoindex cgi dav dav_fs
dav_svn deflate dir env expires fastcgi fcgid include mime
negotiation perl rewrite setenvif ssl status userdir zembperl
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages apache2 depends on:
ii apache2-mpm-prefork 2.2.9-10+lenny1 Apache HTTP Server - traditional n
apache2 recommends no packages.
apache2 suggests no packages.
Versions of packages apache2.2-common depends on:
ii apache2-utils 2.2.9-10+lenny1 utility programs for webservers
ii libapr1 1.2.12-5 The Apache Portable Runtime Librar
ii libaprutil1 1.2.12+dfsg-8 The Apache Portable Runtime Utilit
ii libc6 2.7-16 GNU C Library: Shared libraries
ii libmagic1 4.26-1 File type determination library us
ii libssl0.9.8 0.9.8g-14 SSL shared libraries
ii lsb-base 3.2-20 Linux Standard Base 3.2 init scrip
ii mime-support 3.44-1 MIME files 'mime.types' & 'mailcap
ii net-tools 1.60-22 The NET-3 networking toolkit
ii perl 5.10.0-18 Larry Wall's Practical Extraction
ii procps 1:3.2.7-8 /proc file system utilities
ii zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime
-- no debconf information
Reply to: