Forum Moderators: phranque

Message Too Old, No Replies

mod deflate performance problems - help!

struggles in peak traffic

         

joshm

2:47 am on Nov 2, 2006 (gmt 0)

10+ Year Member



Hello,

I am using the mod_deflate module under Apache 1.3.37 - yes it's possible. It's a patched version for use under apache version 1.3.x. I was previously using mod_gzip and it created countless number of problems so I had to disable it. My last resort was to try mod_deflate. I have noticed it works much better than mod_gzip but i'm still having performance problems when traffic hits its peak each day. My MRTG graph of daily usage can be viewed here [img232.imageshack.us]. You will notice in hour 11-15 was when it started to dip. During this time the pages become incredibly slow to load, and then people keep hitting refresh which doesn't help. You will also notice in the previous day there was a slight dip. The server load average go's up up up. I will try to explain my setup:

Server Version: Apache/1.3.37 (Unix) mod_deflate/1.0.21 PHP/4.4.0 mod_ssl/2.8.28 OpenSSL/0.9.8b

Dell 1750 2x2.4Ghz Xeon 2GB RAM 36GB SCSI

The bulk of my traffic is of a site that uses php with mysql for a database.

If I do not use compression I do not have any performance problems. But there is the dilemma, if I stop using compression, I will be using a lot of excess bandwidth and paying approx $200/month extra. But if I can use mod_deflate it cuts my bandwidth in half and I will actually be under my bandwidth limit - a huge difference. I get 1TB bandwidth each month. I am using about 28GB BW a day whereas without compression I was using about 55GB BW a day. And obviously I prefer to use compression because pages generally load faster for the user. An example, my index page was 90KB's before compression and now 13KB's after compression.

In my httpd.config file, these are my mod_deflate settings:

# To enable mod_deflate you need to add "DeflateEnable On" to you httpd.conf
DeflateEnable On

# Minimum size of the content to compress
DeflateMinLength 3000

# Compression ration (1 best performance & smallest compression) (9 worst
# performance and best compression)
DeflateCompLevel 1

# Don't try to compress proxied content.
DeflateProxied Off

# Minimum HTTP version necessary to enable compression
DeflateHTTP 1.0

# This setting allows you to avoid compressing content for browser that do
# not support it
DeflateDisableRange "MSIE 4."

# Unfortunately mod_defalte does not support masks such as text/* so you
# need to explicitly identify all of the mime types you wish to compress.
DeflateTypes text/plain
DeflateTypes text/html
DeflateTypes application/xml
DeflateTypes application/x-javascript
DeflateTypes text/xml

As you can see above, I set DeflateCompLevel at 1 to try to improve performance. It was previously set at 6. I'm not sure what else to try. I was wondering if mod_deflate could be conflicting with another module which creates a slowness in peak.

I did use about 20MB's of SWAP memory last night which seems insane considering I have 2GB of memory. I previously had 1GB but upgraded about 2 weeks ago.

Please, any help will be much appreciated. I have been trying so many things it is becoming very frustrating. The dilemma is, disable compression and have no performance issues but double bandwidth or try to get mod_deflate working well in peak.

joshm

2:50 pm on Nov 4, 2006 (gmt 0)

10+ Year Member



Can anybody help?

coopster

1:40 am on Nov 7, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member




I am using the mod_deflate module under Apache 1.3.37 - yes it's possible.

Obviously not. Simple question here, but why not upgrade to Apache 2.x where mod_deflate is proven?

joshm

11:47 am on Nov 8, 2006 (gmt 0)

10+ Year Member



No not obviously not. It works quite well under my setup. If I was using it under Apache 2 I would be getting the same problems. I'm not using Apache 2 because it's not as good for what I need. It's just because i'm getting a lot of traffic, the cpu's can't handle all the compression in peak. I have set it up now to not compress my site in peak hours. It's working well.