Difference between revisions of "Using mod gzip to improve MythWeb performance"

From MythTV Official Wiki
Jump to: navigation, search
Line 17: Line 17:
  
 
I put the following lines near all the other [[If Module]] sections:
 
I put the following lines near all the other [[If Module]] sections:
{{Box File|
+
{{Box File||
 
<pre>
 
<pre>
 
   <[[If Module]] mod_gzip.c>
 
   <[[If Module]] mod_gzip.c>

Revision as of 01:12, 30 March 2007

Important.png Note: This guide is for apache 1.x, if you're using apache 2.x you will want to look into mod_deflate.

I run mythweb on my home internet connection, and unfortunately my upload rate is only 300kbps. I have all my channels set to be listed in the mythweb listings (including audio channels) and the listings page comes out to about 1.1MB in size. 1.1MB takes about 30 seconds at 300kbps and if my connection was already being utilized for something else my listings could take over a minute to load.

This became frustrating and I decided to setup mod_gzip for apache. The install was actually pretty easy. The first thing that needs to be accomplished is to make sure mod_gzip is installed. I use debian, so I ran:

apt-get install libapache-mod-gzip

For Fedora or Redhat users you will need to use yum or apt to install the proper package.

Next I edited /etc/apache/httpd.conf (Fedora users will probably have it in /etc/httpd/conf/httpd.conf). The debian package automatically added an entry in /etc/apache/modules.conf to load the module, but fedora users may need to add this (near the top by the other Load Module statements) to /etc/httpd/conf/httpd.conf.

Load Module gzip_module /usr/lib/apache/1.3/mod_gzip.so


Once that was done it was just a matter of configuring mod_gzip. Since this machine only serves up mythweb I turned on mod_gzip for everything. However, if your machine serves up other pages you may want to set this up for only certain directories or virtual hosts.

I put the following lines near all the other If Module sections: Template:Box File

However, putting it anywhere near the top or middle of the config file should work.

Next tail the mod_gzip log file:

# tail -f /var/log/httpd/mod_gzip.log

Now goto your mythweb listings in your browser and you should see something like this show up in your mod_gzip log:

[10/Feb/2005:10:45:10 -0700] "localhost GET /program_listing.php HTTP/1.1" 200 77037 mod_gzip: DECHUNK:OK In:1103726 -< Out:76448 = 94 pct.


If you got anything other than DECHUNK:OK you can view a list of status codes at http://www.schroepl.net/projekte/mod_gzip/status.htm

Using mod_gzip cut my load time down to about 3-10 seconds.