Re: Best compression for mod_perl application?
--- Bill Marrs [EMAIL PROTECTED] wrote: My own personal experience with mod_deflate (in Apache/2.0.46) is that it tends to spike my server's load. My server (gametz.com) is dual http://lists.over.net/pipermail/mod_gzip/2003-June/007130.html seems to say that mod_gzip has its own implementation for compression whereas mod_deflate uses zlib. I am assuming the shared library is somehow at fault here ? Mithun __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com
Best compression for mod_perl application?
I used to use mod_gzip under Apache 1.3, and it worked great, saving my over 50% of my bandwidth for my mod_perl generated pages. But, it appears that mod_gzip doesn't work with Apache 2. Apache 2 has a built-in mod_deflate, but I've had some trouble with it (seemed to cause a load spike on my server + errors if I print ). I recall there used to be alternatives to mod_gzip out there, but I'm not sure if they apply to Apache 2. Are any of you use compression on your mod_perl pages? Do you recommend any compression schemes for the Apache 2/mp2 environment? TIA, -=bill
Re: Best compression for mod_perl application?
HI Bill, mod_gzip gave me a lot of grief when I used it - spurious errors kept filling the log and it didn't work easily with SSL. I spent a day trying to configure a nasty proxy solution. Apache::DynaGZIP has been much less hassle to install and run and it works with SSL. Although, I have not tried it on Apache 2. Kind Rehards, NIgel -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel:+44 (0) 207 987 5460 fax:+44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Best compression for mod_perl application?
Apache::Dynagzip is not supposed to work on Apache-2. That would be of my real interest to know as many details of Bill's experience with mod_deflate as he can provide. Thanks, Slava - Original Message - From: Nigel Hamilton [EMAIL PROTECTED] To: Bill Marrs [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 9:56 AM Subject: Re: Best compression for mod_perl application? HI Bill, mod_gzip gave me a lot of grief when I used it - spurious errors kept filling the log and it didn't work easily with SSL. I spent a day trying to configure a nasty proxy solution. Apache::DynaGZIP has been much less hassle to install and run and it works with SSL. Although, I have not tried it on Apache 2. Kind Rehards, NIgel -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel: +44 (0) 207 987 5460 fax: +44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Best compression for mod_perl application?
Hi Nigel, I had the same question three month ago. There are a few sources which compare the different modules. See mod_perl guide. My solution is now mod_deflate 1.0.18 with apache 1.3.27. My configuration in httpd.conf is: # activate compress IfModule mod_deflate.c # main switch DeflateEnable on DeflateMinLength1024 DeflateCompLevel8 # compress over proxies DeflateProxied on # switch off MSIE 4.x - has bugs DeflateDisableRange MSIE 4. # experimentell - for uploads DeflateVary on # DeflateHTTP 1.1 # default # activate for HTTP 1.0 DeflateHTTP 1.0 # DeflateTypestext/html # default # add more content types for compression DeflateTypestext/css DeflateTypestext/plain DeflateTypestext/rtf DeflateTypestext/xml DeflateTypestext/javascript DeflateTypesimage/vnd.dwg DeflateTypesimage/vnd.dxf DeflateTypesapplication/msword DeflateTypesapplication/vnd.hp-HPGL DeflateTypesapplication/vnd.ms-access DeflateTypesapplication/vnd.ms-excel DeflateTypesapplication/vnd.ms-powerpoint DeflateTypesapplication/vnd.ms-project DeflateTypesapplication/vnd.visio DeflateTypesapplication/x-javascript # pdf does no work # DeflateTypesapplication/pdf /IfModule I hope that helps you. Regards, Sven. Am Die, 2003-07-01 um 17.02 schrieb Slava Bizyayev: Apache::Dynagzip is not supposed to work on Apache-2. That would be of my real interest to know as many details of Bill's experience with mod_deflate as he can provide. Thanks, Slava - Original Message - From: Nigel Hamilton [EMAIL PROTECTED] To: Bill Marrs [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 9:56 AM Subject: Re: Best compression for mod_perl application? HI Bill, mod_gzip gave me a lot of grief when I used it - spurious errors kept filling the log and it didn't work easily with SSL. I spent a day trying to configure a nasty proxy solution. Apache::DynaGZIP has been much less hassle to install and run and it works with SSL. Although, I have not tried it on Apache 2. Kind Rehards, NIgel -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel: +44 (0) 207 987 5460 fax: +44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Best compression for mod_perl application?
And how about http://devl4.outlook.net/devdoc/FAQ/compression.html for Apache 1.3.27? ;-) Slava - Original Message - From: Sven Geisler [EMAIL PROTECTED] To: Nigel Hamilton [EMAIL PROTECTED]; Slava Bizyayev [EMAIL PROTECTED] Cc: Bill Marrs [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 10:48 AM Subject: Re: Best compression for mod_perl application? Hi Nigel, I had the same question three month ago. There are a few sources which compare the different modules. See mod_perl guide. My solution is now mod_deflate 1.0.18 with apache 1.3.27. My configuration in httpd.conf is: # activate compress IfModule mod_deflate.c # main switch DeflateEnable on DeflateMinLength1024 DeflateCompLevel8 # compress over proxies DeflateProxied on # switch off MSIE 4.x - has bugs DeflateDisableRange MSIE 4. # experimentell - for uploads DeflateVary on # DeflateHTTP 1.1 # default # activate for HTTP 1.0 DeflateHTTP 1.0 # DeflateTypestext/html # default # add more content types for compression DeflateTypestext/css DeflateTypestext/plain DeflateTypestext/rtf DeflateTypestext/xml DeflateTypestext/javascript DeflateTypesimage/vnd.dwg DeflateTypesimage/vnd.dxf DeflateTypesapplication/msword DeflateTypesapplication/vnd.hp-HPGL DeflateTypesapplication/vnd.ms-access DeflateTypesapplication/vnd.ms-excel DeflateTypesapplication/vnd.ms-powerpoint DeflateTypesapplication/vnd.ms-project DeflateTypesapplication/vnd.visio DeflateTypesapplication/x-javascript # pdf does no work # DeflateTypesapplication/pdf /IfModule I hope that helps you. Regards, Sven. Am Die, 2003-07-01 um 17.02 schrieb Slava Bizyayev: Apache::Dynagzip is not supposed to work on Apache-2. That would be of my real interest to know as many details of Bill's experience with mod_deflate as he can provide. Thanks, Slava - Original Message - From: Nigel Hamilton [EMAIL PROTECTED] To: Bill Marrs [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 9:56 AM Subject: Re: Best compression for mod_perl application? HI Bill, mod_gzip gave me a lot of grief when I used it - spurious errors kept filling the log and it didn't work easily with SSL. I spent a day trying to configure a nasty proxy solution. Apache::DynaGZIP has been much less hassle to install and run and it works with SSL. Although, I have not tried it on Apache 2. Kind Rehards, NIgel -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel: +44 (0) 207 987 5460 fax: +44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Best compression for mod_perl application?
This is one of the source I had in mind. Well done Slava. BTW. Do you consider the latest version of mod_deflate? Regardsm Sven. Am Die, 2003-07-01 um 18.12 schrieb Slava Bizyayev: And how about http://devl4.outlook.net/devdoc/FAQ/compression.html for Apache 1.3.27? ;-) Slava - Original Message - From: Sven Geisler [EMAIL PROTECTED] To: Nigel Hamilton [EMAIL PROTECTED]; Slava Bizyayev [EMAIL PROTECTED] Cc: Bill Marrs [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 10:48 AM Subject: Re: Best compression for mod_perl application? Hi Nigel, I had the same question three month ago. There are a few sources which compare the different modules. See mod_perl guide. My solution is now mod_deflate 1.0.18 with apache 1.3.27. My configuration in httpd.conf is: # activate compress IfModule mod_deflate.c # main switch DeflateEnable on DeflateMinLength1024 DeflateCompLevel8 # compress over proxies DeflateProxied on # switch off MSIE 4.x - has bugs DeflateDisableRange MSIE 4. # experimentell - for uploads DeflateVary on # DeflateHTTP 1.1 # default # activate for HTTP 1.0 DeflateHTTP 1.0 # DeflateTypestext/html # default # add more content types for compression DeflateTypestext/css DeflateTypestext/plain DeflateTypestext/rtf DeflateTypestext/xml DeflateTypestext/javascript DeflateTypesimage/vnd.dwg DeflateTypesimage/vnd.dxf DeflateTypesapplication/msword DeflateTypesapplication/vnd.hp-HPGL DeflateTypesapplication/vnd.ms-access DeflateTypesapplication/vnd.ms-excel DeflateTypesapplication/vnd.ms-powerpoint DeflateTypesapplication/vnd.ms-project DeflateTypesapplication/vnd.visio DeflateTypesapplication/x-javascript # pdf does no work # DeflateTypesapplication/pdf /IfModule I hope that helps you. Regards, Sven. Am Die, 2003-07-01 um 17.02 schrieb Slava Bizyayev: Apache::Dynagzip is not supposed to work on Apache-2. That would be of my real interest to know as many details of Bill's experience with mod_deflate as he can provide. Thanks, Slava - Original Message - From: Nigel Hamilton [EMAIL PROTECTED] To: Bill Marrs [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 9:56 AM Subject: Re: Best compression for mod_perl application? HI Bill, mod_gzip gave me a lot of grief when I used it - spurious errors kept filling the log and it didn't work easily with SSL. I spent a day trying to configure a nasty proxy solution. Apache::DynaGZIP has been much less hassle to install and run and it works with SSL. Although, I have not tried it on Apache 2. Kind Rehards, NIgel -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel: +44 (0) 207 987 5460 fax: +44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Best compression for mod_perl application?
Thanks Sven, From my current point of view mod_deflate for Apache-2 should be still considered in experimental stage. That's why I so interested to collect as much user experience with mod_deflate-2 as possible. Thanks, Slava - Original Message - From: Sven Geisler [EMAIL PROTECTED] To: Slava Bizyayev [EMAIL PROTECTED] Cc: Nigel Hamilton [EMAIL PROTECTED]; Bill Marrs [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 11:21 AM Subject: Re: Best compression for mod_perl application? This is one of the source I had in mind. Well done Slava. BTW. Do you consider the latest version of mod_deflate? Regardsm Sven. Am Die, 2003-07-01 um 18.12 schrieb Slava Bizyayev: And how about http://devl4.outlook.net/devdoc/FAQ/compression.html for Apache 1.3.27? ;-) Slava - Original Message - From: Sven Geisler [EMAIL PROTECTED] To: Nigel Hamilton [EMAIL PROTECTED]; Slava Bizyayev [EMAIL PROTECTED] Cc: Bill Marrs [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 10:48 AM Subject: Re: Best compression for mod_perl application? Hi Nigel, I had the same question three month ago. There are a few sources which compare the different modules. See mod_perl guide. My solution is now mod_deflate 1.0.18 with apache 1.3.27. My configuration in httpd.conf is: # activate compress IfModule mod_deflate.c # main switch DeflateEnable on DeflateMinLength1024 DeflateCompLevel8 # compress over proxies DeflateProxied on # switch off MSIE 4.x - has bugs DeflateDisableRange MSIE 4. # experimentell - for uploads DeflateVary on # DeflateHTTP 1.1 # default # activate for HTTP 1.0 DeflateHTTP 1.0 # DeflateTypestext/html # default # add more content types for compression DeflateTypestext/css DeflateTypestext/plain DeflateTypestext/rtf DeflateTypestext/xml DeflateTypestext/javascript DeflateTypesimage/vnd.dwg DeflateTypesimage/vnd.dxf DeflateTypesapplication/msword DeflateTypesapplication/vnd.hp-HPGL DeflateTypesapplication/vnd.ms-access DeflateTypesapplication/vnd.ms-excel DeflateTypesapplication/vnd.ms-powerpoint DeflateTypesapplication/vnd.ms-project DeflateTypesapplication/vnd.visio DeflateTypesapplication/x-javascript # pdf does no work # DeflateTypesapplication/pdf /IfModule I hope that helps you. Regards, Sven. Am Die, 2003-07-01 um 17.02 schrieb Slava Bizyayev: Apache::Dynagzip is not supposed to work on Apache-2. That would be of my real interest to know as many details of Bill's experience with mod_deflate as he can provide. Thanks, Slava - Original Message - From: Nigel Hamilton [EMAIL PROTECTED] To: Bill Marrs [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 9:56 AM Subject: Re: Best compression for mod_perl application? HI Bill, mod_gzip gave me a lot of grief when I used it - spurious errors kept filling the log and it didn't work easily with SSL. I spent a day trying to configure a nasty proxy solution. Apache::DynaGZIP has been much less hassle to install and run and it works with SSL. Although, I have not tried it on Apache 2. Kind Rehards, NIgel -- Nigel Hamilton Turbo10 Metasearch Engine email: [EMAIL PROTECTED] tel: +44 (0) 207 987 5460 fax: +44 (0) 207 987 5468 http://turbo10.com Search Deeper. Browse Faster.
Re: Best compression for mod_perl application?
That would be of my real interest to know as many details of Bill's experience with mod_deflate as he can provide. Since I posted my first message, I've been snooping around the 'net to find more info on mod_gzip and mod_deflate. Here's what I came up with: The general recommendation seems to be migration from mod_gzip to mod_deflate when you switch to Apache 2.0. mod_gzip seems to have lost most of its support going forward while mod_deflate is part of the Apache source code and has active development. There is a Apache 2.0 compatible version of mod_gzip, here: http://www.gknw.de/development/apache/httpd-2.0/unix/modules/ When I tried it, it didn't work for me. It caused my site to spit out blank pages and garbage. I had used my old Apache 1.3 mod_gzip config with it. I read that there's some odd timing issues where the Apache 2.0 version of mod_gzip branched a long time ago and thus doesn't have some of the modern mod_gzip 1.3.x features. I didn't get config errors, though, just blanks and garbage. So, I decided to back away slowly for mod_gzip on Apache 2.0. There is more discussion of it here: http://freshmeat.net/projects/mod_gzip/?topic_id=90 There a good mod_gzip info page here, though little is said about a 2.0 version: http://www.schroepl.net/projekte/mod_gzip/index.htm The mod_gzip mailing list has some good info. Here's a 26 Jun 2003 post by someone who seems to know well what's going on (I think the author of the above page): Subject: [Mod_gzip] gzip vs deflate on Apache http://lists.over.net/pipermail/mod_gzip/2003-June/007130.html So, I decided to try harder to move ahead with mod_deflate. I'm using a built from scratch, Apache/2.0.46 mod_perl_1.99_09. Work is being done on mod_deflate, some recent directives has been added (I hear). One of which is DeflateCompressionLevel. Along with this addition in 2.0.44 came a better default for this compression level. It's now 6, the same thing that gzip and zlib uses by default. Apparently, it had been 1 before that, which is fast but doesn't compress very well. There's some discussion of this here: http://www.webcompression.org/deflate-compress.html My own personal experience with mod_deflate (in Apache/2.0.46) is that it tends to spike my server's load. My server (gametz.com) is dual 800Mhz, 1.5GB ram, Linux, doing about 70K pages/day. Last night, I happened to be watching it while the load jumped up a few points during my site's prime time, so I pulled mod_deflate out of the config file and that fixed it. So, today, I'm trying a lower DeflateCompressionLevel. I'm using 4 now (instead of the default 6). This seems better, though the load is still a little higher than it should be and I'm not quote at prime time yet. Still, I am getting decent compression. I'm going to keep an eye on it, I suspect I'll be at 3 later this evening. I never had any trouble with load when I used mod_gzip and Apache 1.3. The other odd problem I got was that if anywhere in my perl code I printed nothing (e.g. print or $foo=;print $foo), I'd get this error: error: 20014:Error string not specified yet at /my/perl/code.pl line 123 This error was both blurted to the error_log and to the web page (screwing up the page and truncating further output). I changed my code to print instead of (HTML ignores extra white-space, so no biggie), and the errors all went away. So, I see this as an annoyance more than a serious bug. I really should try to tell the author of mod_deflate about these problems. Here's the config I'm using for mod_deflate: # ## Deflate # LoadModule deflate_module modules/mod_deflate.so AddOutputFilterByType DEFLATE text/* SetOutputFilter DEFLATE # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary DeflateBufferSize 8096 # DeflateCompressionLevel 6 DeflateCompressionLevel 4 DeflateMemLevel 9 DeflateWindowSize 15 DeflateFilterNote Input instream DeflateFilterNote Output outstream DeflateFilterNote Ratio ratio LogFormat '%r %{outstream}n/%{instream}n (%{ratio}n%%) %{User-agent}i' defl\ ate CustomLog /var/log/httpd/deflate_log deflate All of which I cribbed from the Apache 2.0 manual: http://httpd.apache.org/docs-2.0/mod/mod_deflate.html I sort of got forced into upgrading to Apache 2.0/mp2/etc. by RedHat. They announced they would pull support for old releases (all that used Apache 1.3) by the end of the year. Apparently, this may be an intentional (evil?) business move by them to motivate more customers to move to their Enterprise OS (which is very expensive, but has more stable software like good old Apache 1.3 mp1). I did try to go back at one point, builing Apache 1.3 from source, but it had some other problem (maybe, because I used Perl 5.8.0?). But, then I waffled and decided there's also a lot of value in staying current. So, I'm back to 2.0 land, and I'm surviving so far. -=bill
Re: Best compression for mod_perl application?
Hi Bill, Thanks for taking the time to post your experiences. It's a shame that so much time is spent tweaking, compiling, testing, ferretting for bug references. On Tue, 1 Jul 2003, Bill Marrs wrote: That would be of my real interest to know as many details of Bill's experience with mod_deflate as he can provide. Since I posted my first message, I've been snooping around the 'net to find more info on mod_gzip and mod_deflate. Here's what I came up with: The general recommendation seems to be migration from mod_gzip to mod_deflate when you switch to Apache 2.0. mod_gzip seems to have lost most of its support going forward while mod_deflate is part of the Apache source code and has active development. There is a Apache 2.0 compatible version of mod_gzip, here: http://www.gknw.de/development/apache/httpd-2.0/unix/modules/ When I tried it, it didn't work for me. It caused my site to spit out blank pages and garbage. I had used my old Apache 1.3 mod_gzip config with it. I read that there's some odd timing issues where the Apache 2.0 version of mod_gzip branched a long time ago and thus doesn't have some of the modern mod_gzip 1.3.x features. I didn't get config errors, though, just blanks and garbage. So, I decided to back away slowly for mod_gzip on Apache 2.0. There is more discussion of it here: http://freshmeat.net/projects/mod_gzip/?topic_id=90 There a good mod_gzip info page here, though little is said about a 2.0 version: http://www.schroepl.net/projekte/mod_gzip/index.htm The mod_gzip mailing list has some good info. Here's a 26 Jun 2003 post by someone who seems to know well what's going on (I think the author of the above page): Subject: [Mod_gzip] gzip vs deflate on Apache http://lists.over.net/pipermail/mod_gzip/2003-June/007130.html So, I decided to try harder to move ahead with mod_deflate. I'm using a built from scratch, Apache/2.0.46 mod_perl_1.99_09. Work is being done on mod_deflate, some recent directives has been added (I hear). One of which is DeflateCompressionLevel. Along with this addition in 2.0.44 came a better default for this compression level. It's now 6, the same thing that gzip and zlib uses by default. Apparently, it had been 1 before that, which is fast but doesn't compress very well. There's some discussion of this here: http://www.webcompression.org/deflate-compress.html My own personal experience with mod_deflate (in Apache/2.0.46) is that it tends to spike my server's load. My server (gametz.com) is dual 800Mhz, 1.5GB ram, Linux, doing about 70K pages/day. Last night, I happened to be watching it while the load jumped up a few points during my site's prime time, so I pulled mod_deflate out of the config file and that fixed it. So, today, I'm trying a lower DeflateCompressionLevel. I'm using 4 now (instead of the default 6). This seems better, though the load is still a little higher than it should be and I'm not quote at prime time yet. Still, I am getting decent compression. I'm going to keep an eye on it, I suspect I'll be at 3 later this evening. I never had any trouble with load when I used mod_gzip and Apache 1.3. The other odd problem I got was that if anywhere in my perl code I printed nothing (e.g. print or $foo=;print $foo), I'd get this error: error: 20014:Error string not specified yet at /my/perl/code.pl line 123 This error was both blurted to the error_log and to the web page (screwing up the page and truncating further output). I changed my code to print instead of (HTML ignores extra white-space, so no biggie), and the errors all went away. So, I see this as an annoyance more than a serious bug. I really should try to tell the author of mod_deflate about these problems. Here's the config I'm using for mod_deflate: # ## Deflate # LoadModule deflate_module modules/mod_deflate.so AddOutputFilterByType DEFLATE text/* SetOutputFilter DEFLATE # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary DeflateBufferSize 8096 # DeflateCompressionLevel 6 DeflateCompressionLevel 4 DeflateMemLevel 9 DeflateWindowSize 15 DeflateFilterNote Input instream DeflateFilterNote Output outstream DeflateFilterNote Ratio ratio LogFormat '%r %{outstream}n/%{instream}n (%{ratio}n%%) %{User-agent}i' defl\ ate CustomLog /var/log/httpd/deflate_log deflate All of which I cribbed from the Apache 2.0 manual: http://httpd.apache.org/docs-2.0/mod/mod_deflate.html I sort of got forced into upgrading to Apache 2.0/mp2/etc. by RedHat. They announced they would pull support for old releases (all that used Apache 1.3) by the end of the year. Apparently, this may be an intentional (evil?) business move by them to motivate more customers to move to their Enterprise OS (which is very expensive, but has more stable software like good
Re: Best compression for mod_perl application?
The other odd problem I got was that if anywhere in my perl code I printed nothing (e.g. print or $foo=;print $foo), I'd get this error: error: 20014:Error string not specified yet at /my/perl/code.pl line 123 This error was both blurted to the error_log and to the web page (screwing up the page and truncating further output). I changed my code to print instead of (HTML ignores extra white-space, so no biggie), and the errors all went away. So, I see this as an annoyance more than a serious bug. if you're using mod_perl for your perl script, it might be a mod_perl issue an not mod_deflate - try the same from a mod_cgi script and see if it has the same problem. if not, we probably need to dig around mod_perl core for a fix. --Geoff
Re: Best compression for mod_perl application?
Hi Bill, Thank you very much for the story. It makes sense. Just a couple of questions: 1. Are you using any Cascaded Stile Sheets and/of JavaScript libraries linked to your main web pages? 2. If yes, how do you turn compression off for those files in case of Netscape-4 originated request? Thanks, Slava - Original Message - From: Bill Marrs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 2:33 PM Subject: Re: Best compression for mod_perl application? That would be of my real interest to know as many details of Bill's experience with mod_deflate as he can provide. Since I posted my first message, I've been snooping around the 'net to find more info on mod_gzip and mod_deflate. Here's what I came up with: The general recommendation seems to be migration from mod_gzip to mod_deflate when you switch to Apache 2.0. mod_gzip seems to have lost most of its support going forward while mod_deflate is part of the Apache source code and has active development. There is a Apache 2.0 compatible version of mod_gzip, here: http://www.gknw.de/development/apache/httpd-2.0/unix/modules/ When I tried it, it didn't work for me. It caused my site to spit out blank pages and garbage. I had used my old Apache 1.3 mod_gzip config with it. I read that there's some odd timing issues where the Apache 2.0 version of mod_gzip branched a long time ago and thus doesn't have some of the modern mod_gzip 1.3.x features. I didn't get config errors, though, just blanks and garbage. So, I decided to back away slowly for mod_gzip on Apache 2.0. There is more discussion of it here: http://freshmeat.net/projects/mod_gzip/?topic_id=90 There a good mod_gzip info page here, though little is said about a 2.0 version: http://www.schroepl.net/projekte/mod_gzip/index.htm The mod_gzip mailing list has some good info. Here's a 26 Jun 2003 post by someone who seems to know well what's going on (I think the author of the above page): Subject: [Mod_gzip] gzip vs deflate on Apache http://lists.over.net/pipermail/mod_gzip/2003-June/007130.html So, I decided to try harder to move ahead with mod_deflate. I'm using a built from scratch, Apache/2.0.46 mod_perl_1.99_09. Work is being done on mod_deflate, some recent directives has been added (I hear). One of which is DeflateCompressionLevel. Along with this addition in 2.0.44 came a better default for this compression level. It's now 6, the same thing that gzip and zlib uses by default. Apparently, it had been 1 before that, which is fast but doesn't compress very well. There's some discussion of this here: http://www.webcompression.org/deflate-compress.html My own personal experience with mod_deflate (in Apache/2.0.46) is that it tends to spike my server's load. My server (gametz.com) is dual 800Mhz, 1.5GB ram, Linux, doing about 70K pages/day. Last night, I happened to be watching it while the load jumped up a few points during my site's prime time, so I pulled mod_deflate out of the config file and that fixed it. So, today, I'm trying a lower DeflateCompressionLevel. I'm using 4 now (instead of the default 6). This seems better, though the load is still a little higher than it should be and I'm not quote at prime time yet. Still, I am getting decent compression. I'm going to keep an eye on it, I suspect I'll be at 3 later this evening. I never had any trouble with load when I used mod_gzip and Apache 1.3. The other odd problem I got was that if anywhere in my perl code I printed nothing (e.g. print or $foo=;print $foo), I'd get this error: error: 20014:Error string not specified yet at /my/perl/code.pl line 123 This error was both blurted to the error_log and to the web page (screwing up the page and truncating further output). I changed my code to print instead of (HTML ignores extra white-space, so no biggie), and the errors all went away. So, I see this as an annoyance more than a serious bug. I really should try to tell the author of mod_deflate about these problems. Here's the config I'm using for mod_deflate: # ## Deflate # LoadModule deflate_module modules/mod_deflate.so AddOutputFilterByType DEFLATE text/* SetOutputFilter DEFLATE # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary DeflateBufferSize 8096 # DeflateCompressionLevel 6 DeflateCompressionLevel 4 DeflateMemLevel 9 DeflateWindowSize 15 DeflateFilterNote Input instream DeflateFilterNote Output outstream DeflateFilterNote Ratio ratio LogFormat '%r %{outstream}n/%{instream}n (%{ratio}n%%) %{User-agent}i' defl\ ate CustomLog /var/log/httpd/deflate_log deflate All of which I cribbed from the Apache 2.0 manual: http://httpd.apache.org/docs-2.0/mod/mod_deflate.html I sort of got forced into upgrading to Apache 2.0/mp2/etc. by RedHat. They announced they would pull support for old releases (all that used Apache 1.3) by the end
Re: Best compression for mod_perl application?
1. Are you using any Cascaded Stile Sheets and/of JavaScript libraries linked to your main web pages? I'm not, but... I think mod_defalte's hook is after all that is processed, so it's not especially relevant. 2. If yes, how do you turn compression off for those files in case of Netscape-4 originated request? http://httpd.apache.org/docs-2.0/mod/mod_deflate.html says to use this sort of thing: # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Don't compress images SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary
Re: Best compression for mod_perl application?
It's amazing! The flow control system is definitely sufficient. Ian Holsman really developed a very good module. The rest is up to accomplishing filters those supposed to be simple and specific. Those minor bug with optional empty chunk in the middle of the body should be easy to fix. Thanks, Slava - Original Message - From: Bill Marrs [EMAIL PROTECTED] To: Slava Bizyayev [EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 3:33 PM Subject: Re: Best compression for mod_perl application? 1. Are you using any Cascaded Stile Sheets and/of JavaScript libraries linked to your main web pages? I'm not, but... I think mod_defalte's hook is after all that is processed, so it's not especially relevant. 2. If yes, how do you turn compression off for those files in case of Netscape-4 originated request? http://httpd.apache.org/docs-2.0/mod/mod_deflate.html says to use this sort of thing: # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Don't compress images SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary