You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Anantha Padmanabha <an...@bankbazaar.com> on 2009/07/28 14:31:19 UTC

[users@httpd] Deflate - Logging ratios

Hi,

I am using Apache 2.2.8. I tried to add logging for deflate [gzip] ratios in
a dev machine by looking at
http://httpd.apache.org/docs/2.0/mod/mod_deflate.html and some other
articles on internet.

Heres the configuration used:
<IfModule mod_deflate.c>
   AddOutputFilterByType DEFLATE text/html text/plain text/xml
</IfModule>

DeflateFilterNote Input instr
DeflateFilterNote Output outstr
DeflateFilterNote ratio
LogFormat
"%h\t%l\t%u\t%t\t\"%r\"\t%>s\t%b\t%D\t\"%{User-Agent}i\"\t%I\t%O\t%{outstr}n/%{instr}n\t(%{ratio}n)"
common

Logging is working fine but the ratio is not appearing for html files [It
gets printed for css/js files]

192.168.0.57    -       -       [28/Jul/2009:17:56:57 +0530]    "GET
/credit-card/apply-online.html HTTP/1.1"   200     14722   418995
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090624
Firefox/3.5"  1257    15257   -/-     (-)
192.168.0.57    -       -       [28/Jul/2009:17:56:58 +0530]    "GET
/scripts/validate/ccefrm.js HTTP/1.1"      200     2325    11741
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090624
Firefox/3.5"  1225    2974    2307/9821       (23)

I verified using lwp-request, curl and online tools that our configs are
compressing pages while serving.
anantha@anantha-laptop:~$ lwp-request -e -d -H 'Accept-Encoding: gzip'
http://local.bankbazaar.com/ |grep -i -e Content-Encoding -e Content-Length
Content-Encoding: gzip
Content-Length: 8793

Please help me understand why ratio is not appearing for html files.

Thanks
Anantha

Re: [users@httpd] Deflate - Logging ratios

Posted by Anantha Padmanabha <an...@bankbazaar.com>.
Hi Eric,

I added content-encoding and the logs are similar:

192.168.0.57    -       -       [28/Jul/2009:21:28:06 +0530]    "GET
/bankdb/dashboard.html HTTP/1.1"   200     16183   1151294 "Mozilla/5.0
(X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5"  1289
16729   -/-     (-)     gzip
192.168.0.57    -       -       [28/Jul/2009:21:28:07 +0530]    "GET
/scripts/jquery/jquery.validate.js HTTP/1.1"       200     9194    6507
"Mozilla/5.0(X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090624
Firefox/3.5"  965     9721    9176/34766      (26)    gzip
192.168.0.57    -       -       [28/Jul/2009:21:28:09 +0530]    "GET
/styles/bankdb2_additional.css HTTP/1.1"   200     2004    1873
"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090624
Firefox/3.5"  1241    2638    1986/10886      (18)    gzip
192.168.0.57    -       -       [28/Jul/2009:21:28:09 +0530]    "GET
/images/phone_sound.png HTTP/1.1"  200     703     443     "Mozilla/5.0
(X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5"  981
1082    -/-     (-)     -

Images dont get compressed and hence content-encoding does not mention gzip.
But html mentions gzip but does not print the ratio. Could it be buggy
module? How to investigate further?

Regarding your question about logs and command line differing, I was trying
it from my firefox browser.
I had run it from command line to verify that gzip comes back in responde
header. Also verified that for requests from command line also ratio is not
present in logs

Thanks
Anantha

On Tue, Jul 28, 2009 at 7:10 PM, Eric Covener <co...@gmail.com> wrote:

> On Tue, Jul 28, 2009 at 8:31 AM, Anantha
> Padmanabha<an...@bankbazaar.com> wrote:
>
> >    AddOutputFilterByType DEFLATE text/html text/plain text/xml
>
>
> > 192.168.0.57    -       -       [28/Jul/2009:17:56:57 +0530]    "GET
> > /credit-card/apply-online.html HTTP/1.1"   200     14722   418995
> > "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090624
> > Firefox/3.5"  1257    15257   -/-     (-)
> > 192.168.0.57    -       -       [28/Jul/2009:17:56:58 +0530]    "GET
> > /scripts/validate/ccefrm.js HTTP/1.1"      200     2325    11741
> > "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090624
> > Firefox/3.5"  1225    2974    2307/9821       (23)
> >
> > Please help me understand why ratio is not appearing for html files.
>
> Do you have some other DEFLATE configuration? Your results seem
> unusually opposite of what your config is.
>
> Why dos your access log not show the same request as your command line
> client?
>
> Do you disable compression via any SetEnv/SetEnvIf?  Can you log
> %{Content-Encoding}o?
>
>
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

Re: [users@httpd] Deflate - Logging ratios

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jul 28, 2009 at 8:31 AM, Anantha
Padmanabha<an...@bankbazaar.com> wrote:

>    AddOutputFilterByType DEFLATE text/html text/plain text/xml


> 192.168.0.57    -       -       [28/Jul/2009:17:56:57 +0530]    "GET
> /credit-card/apply-online.html HTTP/1.1"   200     14722   418995
> "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090624
> Firefox/3.5"  1257    15257   -/-     (-)
> 192.168.0.57    -       -       [28/Jul/2009:17:56:58 +0530]    "GET
> /scripts/validate/ccefrm.js HTTP/1.1"      200     2325    11741
> "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1) Gecko/20090624
> Firefox/3.5"  1225    2974    2307/9821       (23)
>
> Please help me understand why ratio is not appearing for html files.

Do you have some other DEFLATE configuration? Your results seem
unusually opposite of what your config is.

Why dos your access log not show the same request as your command line client?

Do you disable compression via any SetEnv/SetEnvIf?  Can you log
%{Content-Encoding}o?



-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org