DSM

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • apache 2, mod_deflate, mod_fastcgi,

    5 answers - 4451 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hello,
    It seems that if I use mod_deflate to compress zope's responses, I take a
    major hit -- around 1.4 seconds without compression and around 16.4 seconds
    with. I can't figure out what I'm doing wrong here.
    I have zope 2.7.7 running with the fast-cgi ZServer enabled. Urls beginning
    with http://pkfinance.info/pkf-z1/ go to Zope. Here's what I see:
    a% /usr/bin/time curl -v -o /dev/null
    * About to connect() to pkfinance.info <http://pkfinance.infoport 80
    * Trying 207.210.209.230 connected
    * Connected to pkfinance.info <http://pkfinance.info>
    (207.210.209.230<http://207.210.209.230>)
    port 80
    GET /pkf-z1/news/index_html HTTP/1.1
    User-Agent: curl/7.14.0 (i386-portbld-freebsd4.11) libcurl/7.14.0
    SSL/0.9.7d zlib/1.1.4
    Host: pkfinance.info <http://pkfinance.info>
    Accept: */*
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 0:00:01 0< HTTP/1.1 200 K
    < Date: Wed, 17 Aug 2005 06:57:57 GMT
    < Server: Apache/2.0.54 (FreeBSD) DAV/2 PHP/4.3.11 mod_webkit2/0.5
    mod_fastcgi/2.4.2
    < X-Powered-By: Zope (www.zope.org <http://www.zope.org>), Python (
    www.python.org <http://www.python.org>)
    < Content-Length: 65751
    < Vary: Accept-Encoding,User-Agent
    < Content-Type: text/html; charset=IS
    100 65751 100 65751 0 0 44744 0 0:00:01 0:00:01 196k* Connection #0
    to host pkfinance.info <http://pkfinance.infoleft intact
    * Closing connection #0
    1.48 real 0.00 user 0.00 sys
    a%
    a% /usr/bin/time curl -v -o /dev/null
    * About to connect() to pkfinance.info <http://pkfinance.infoport 80
    * Trying 207.210.209.230 connected
    * Connected to pkfinance.info <http://pkfinance.info>
    (207.210.209.230<http://207.210.209.230>)
    port 80
    GET /pkf-z1/news/index_html HTTP/1.1
    User-Agent: curl/7.14.0 (i386-portbld-freebsd4.11) libcurl/7.14.0
    SSL/0.9.7d zlib/1.1.4
    Host: pkfinance.info <http://pkfinance.info>
    Accept: */*
    Accept-Encoding: deflate, gzip
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 0:00:01 0< HTTP/1.1 200 K
    < Date: Wed, 17 Aug 2005 07:00:10 GMT
    < Server: Apache/2.0.54 (FreeBSD) DAV/2 PHP/4.3.11 mod_webkit2/0.5
    mod_fastcgi/2.4.2
    < X-Powered-By: Zope (www.zope.org <http://www.zope.org>), Python (
    www.python.org <http://www.python.org>)
    < Content-Length: 65751
    < Vary: Accept-Encoding,User-Agent
    < Content-Encoding: gzip
    < Content-Type: text/html; charset=IS
    13 65751 13 8719 0 0 530 0 0:02:04 0:00:16 0:01:48 0transfer closed with
    57032 bytes remaining to read
    13 65751 13 8719 0 0 530 0 0:02:04 0:00:16 0:01:48 0* Closing connection #0
    curl: (18) transfer closed with 57032 bytes remaining to read
    16.46 real 0.01 user 0.01 sys
    a%
    The relevant bits of my httpd.conf:
    <IfModule mod_fastcgi.c>
    FastCgiExternalServer / -socket
    / -pass-header Authorization
    </IfModule>
    <VirtualHost *>
    ServerName pkfinance.info <http://pkfinance.info>
    ServerAlias www.pkfinance.info <http://www.pkfinance.info>
    ServerAdmin faried (AT) gmail (DOT) com
    DocumentRoot /
    ErrorLog /
    CustomLog / combined
    # zope
    <IfModule mod_fastcgi.c>
    <Location /pkf-z1>
    SetHandler fastcgi-script
    SFilter DEFLATE
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    Header append Vary User-Agent env=!dont-vary
    </Location>
    DeflateFilterNote Input instream
    DeflateFilterNote outstream
    DeflateFilterNote Ratio ratio
    LogFormat '%t "%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
    CustomLog / deflate
    </IfModule>
    </VirtualHost>
    In my deflate log I see stuff like
    [16/Aug/2005:11:40:03 -0500] "GET /pkf-z1/news/index_html HTTP/1.1"
    8852/64328 (13%)
    Thanks,
    Faried.
    Zope maillist - Zope (AT) zope (DOT) org
    ** No cross posts or HTML encoding! **
    (Related lists -
    )
  • No.1 | | 1198 bytes | |

    PGP SIGNED MESSAGE
    Hash: SHA1

    Faried Nawaz wrote:

    It seems that if I use mod_deflate to compress zope's responses, I take a
    major hit -- around 1.4 seconds without compression and around 16.4 seconds
    with. I can't figure out what I'm doing wrong here.

    I have zope 2.7.7 running with the fast-cgi ZServer enabled. Urls beginning
    with http://pkfinance.info/pkf-z1/ go to Zope. Here's what I see:

    You seem to be running Apache and Zope on the same host, and trying to
    use the same constrained resource (CPU) from each. You might be able to
    improve performance by running Apache on a separate box, where it won't
    "steal" CPU from Zope to do the compression.

    Tres.
    - --
    Tres Seaver +1 202-558-7113 tseaver (AT) palladion (DOT) com
    Palladion Software "Excellence by Design" http://palladion.com
    PGP SIGNATURE
    Version: GnuPG v1.2.5 (GNU/Linux)
    Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

    KzpIFjJRnIwJJPoL19X0TvI=
    =BUsz
    PGP SIGNATURE

    Zope maillist - Zope (AT) zope (DOT) org

    ** No cross posts or HTML encoding! **
    (Related lists -

    )
  • No.2 | | 545 bytes | |

    I tried messing with it some more, and it seems that the fix was to place

    <tal:foo define="ret python:
    (container.REQUEST)"
    tal:omit-tag="" />

    somewhere near the top of my template. I didn't realize I needed
    compression enabled in zope; I thought apache's mod_deflate would be
    sufficient.

    Someone should add this to the docs or wiki or someplace.

    Faried.

    Zope maillist - Zope (AT) zope (DOT) org

    ** No cross posts or HTML encoding! **
    (Related lists -

    )
  • No.3 | | 416 bytes | |

    Faried Nawaz wrote at 2005-8-17 12:21 +0500:
    >It seems that if I use mod_deflate to compress zope's responses, I take a
    >major hit -- around 1.4 seconds without compression and around 16.4 seconds
    >with. I can't figure out what I'm doing wrong here.


    Looks as if you should not use "mod_deflate".

    Zope can perform "gzip" compression by itself.
  • No.4 | | 590 bytes | |

    8/18/05, Dieter Maurer <dieter (AT) handshake (DOT) dewrote:
    Looks as if you should not use "mod_deflate".

    Zope can perform "gzip" compression by itself.

    As you probably read in my previous email, I have rules defined in
    Apache to handle various browsers and proxies when dealing with
    possibly gzip'd content. How do I do the same in Zope?

    (Also, I have static content on the site that can benefit from mod_deflate.)

    Zope maillist - Zope (AT) zope (DOT) org

    ** No cross posts or HTML encoding! **
    (Related lists -

    )
  • No.5 | | 1155 bytes | |

    Faried Nawaz wrote at 2005-8-18 02:12 +0500:
    8/18/05, Dieter Maurer <dieter (AT) handshake (DOT) dewrote:
    >Looks as if you should not use "mod_deflate".
    >
    >Zope can perform "gzip" compression by itself.
    >
    >As you probably read in my previous email, I have rules defined in
    >Apache to handle various browsers and proxies when dealing with
    >possibly gzip'd content. How do I do the same in Zope?


    Zope's "gzip" support is enabled (for a single request) by
    calling "RESPNSE.enableHTTPCompression" in that request.

    You have all request headers and the full power of Python available
    to dertermine when you want to call it (this gives you more power
    than you have in Apache).

    >(Also, I have static content on the site that can benefit from mod_deflate.)


    If "static content" means "File/Image" objects, then their
    so called "precondition" can get the "enableHTTPCompression".

    Check beforehand, whether compression really saves something.
    While I expect it for "bmp", I am not so sure for "jpg", e.g.

Re: apache 2, mod_deflate, mod_fastcgi,


max 4000 letters.
Your nickname that display:
In order to stop the spam: 1 + 0 =
QUESTION ON "DSM"

EMSDN.COM