The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mod_gzip optimization

Discussion in 'General Discussion' started by Radio_Head, Oct 21, 2004.

  1. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    38
    Cpanel install a preconfigured mod_gzip installing apache

    I suggest these modifications

    FROM
    mod_gzip_maximum_file_size 0
    TO
    mod_gzip_maximum_file_size 500000

    0 means unlimited and it could be a problem with extremely large html files

    FROM
    mod_gzip_temp_dir /tmp
    TO
    mod_gzip_temp_dir /tmp/gzip
    (don't forget to do #mkdir /tmp/gzip;chmod 777 /tmp/gzip)

    so you can track mod_gzip usage better .

    FROM
    mod_gzip_maximum_inmem_size 1000000
    TO
    mod_gzip_maximum_inmem_size 60000

    (I cannot understand why Cpanel set a value so high, 1000000 ! It could cause problems)


    then I suggest you to ADD
    mod_gzip_min_http 1000
    mod_gzip_handle_methods GET POST


    REMOVE LINE
    mod_gzip_item_exclude reqheader "User-agent: Mozilla/4.0[678]"
    bugzilla
    http://bugzilla.cpanel.net/show_bug.cgi?id=1458

    Infact documents writes
    # From version 1.3.19.2a on I advise against using filters
    # for User-agents, as this will cause HTTP-Headers 'Vary: User-Agent'
    # to be generated


    If you want log for some time to check out it works
    ADD
    LogFormat "%h %l %u %t \"%V %r\" %<s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n -< Out:%{mod_gzip_output_size}n = %{mod_gzip_compression_ratio}n pct." common_with_mod_gzip_info2

    CustomLog logs/mod_gzip.log common_with_mod_gzip_info2
    mod_gzip_add_header_count Yes


    Restart apache

    To understand messages received in mod_giz log file
    read http://www.schroepl.net/projekte/mod_gzip/status.htm



    Then comment these lines if you are just using a php accelerator (for example mmcache)
    #mod_gzip_item_include file \.php$
    #mod_gzip_item_include file \.phps$
    #mod_gzip_item_include mime ^application/x-httpd-php.*



    DOCUMENTATION
    http://www.schroepl.net/projekte/mod_gzip/config.htm
     
    #1 Radio_Head, Oct 21, 2004
    Last edited: Oct 21, 2004
  2. pcdior

    pcdior Active Member

    Joined:
    Aug 1, 2004
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for the post
     
  3. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    38

    good to see someone read it :)
     
  4. nickn

    nickn Well-Known Member
    PartnerNOC

    Joined:
    Jun 15, 2003
    Messages:
    619
    Likes Received:
    1
    Trophy Points:
    18
    Agreed, very useful post. :)
     
  5. Rubas

    Rubas Well-Known Member

    Joined:
    Sep 15, 2003
    Messages:
    125
    Likes Received:
    0
    Trophy Points:
    16
    Some additions for the configuration:

    mod_gzip_send_vary Yes

    <Files ~ "\.(gif|jpe?g|png|bmp)$">
    mod_gzip_on no
    </Files>
     
  6. damainman

    damainman Well-Known Member

    Joined:
    Nov 13, 2003
    Messages:
    515
    Likes Received:
    0
    Trophy Points:
    16
    I read it when you first posted it :)... was waiting to see if cpanel responded to it though.
     
  7. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    38
  8. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Instead of this you could include the line:

    Code:
    mod_gzip_item_exclude mime ^image/
    This comparision seems a little less intentsive than the above quoted comparision and so might reduce load a little.

    Although please correct me if I'm wrong!
     
  9. checksoft

    checksoft Well-Known Member

    Joined:
    Mar 16, 2002
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    This bug has recently been added to the database. Nobody has validated that this bug is true. Users who have the "canconfirm" permission set may confirm this bug, changing its state to NEW. Or, it may be directly resolved and marked RESOLVED.

    Looks like it still isn't ready for prime time?
     
  10. dynaweb

    dynaweb Well-Known Member

    Joined:
    May 14, 2003
    Messages:
    71
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Oregon
    Sorry to resurrect, but it will surely be helpful to some. You say
    but beware of this RE http://forums.cpanel.net/showthread.php?t=45139
     
  11. katmai

    katmai Well-Known Member

    Joined:
    Mar 13, 2006
    Messages:
    526
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Brno, Czech Republic
    this is really cool. gotta check it out.
     
  12. figure8hosting

    Joined:
    May 24, 2007
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    I would suggest using Apache's deflate module instead of gzip, since it is still unstable in cPanel.
     
Loading...
Similar Threads - mod_gzip optimization
  1. Ajeje989
    Replies:
    1
    Views:
    167

Share This Page