Knowledgebase

mod_deflate, increases or decreases performance?

Posted by DjiXas, 08-28-2008, 04:30 AM
Hey there, I'm kinda confused by mod_deflate. I know that it's using CPU power, etc, but if it will be turned on, would it decrease cpu power or not? The reason why ask is this: Non compressed html file is 20 KB And compressed html file is 5 KB So assume that I am using mod deflate to compress file which requires cpu resources. However, CPU will have to serve only 5 KB of html doc instead of 20 KB to a surfer, therefore it would use cpu power for a lower period of time. So it would be: a) Increased CPU usage and surfers performance b) CPU usage would be about the same, increased surfers performance ?

Posted by CoderJosh, 08-28-2008, 06:47 AM
Serving a static file doesn't consume much CPU time compared to compressing a file, so CPU-wise mod_deflate will likely decrease your performance. But there are other factors to consider: The bandwidth consumption will decrease, the client will typically receive the file quicker and the server might be able to serve more clients at the same time, as each connection doesn't last that long. I'd say that these factors over-compensate the higher CPU utilization quite often, as the CPU tends to be quite idle in many web servers, especially those serving mostly static content.

Posted by DjiXas, 08-28-2008, 06:57 AM
Thanks a lot Josh.

Posted by livechatr, 08-28-2008, 07:06 AM
Probably, you can do it this way: for all your static pages have two versions: plain and deflated, and serve either one depending on browser support (check AcceptEncoding header). But this might probably involve some programming.

Posted by DjiXas, 08-28-2008, 08:04 AM
Are there any browsers which doesn't support that? If so, IE6 or IE5?

Posted by livechatr, 08-28-2008, 08:12 AM
It seems that all the modern browsers support it. But, as a programmer I tend to play different scenarios in my mind, that's why I would better check for it... just to be on the safe side. Also, you probably want to run some kind of benchmark to see which scenario puts the least load on the CPU without suffering the speed too much.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Reliaspace nightmares! (Views: 618)


Language:

Client Login

Email

Password

Remember Me

Search