2

I have a server that currently does a lot of processing in my application and the target users are those who have a very good internet connection.

The output that is sent from the server is always text/html and we do not use any media (audio/video) only images (static site images like logo,etc).

We are experiencing severe performance issues and I wonder if turning off gzip/mod_deflate on the server so that the server would avoid compressing the output. Will this cause an improvement in performance?

Scott Pack
  • 14,717
  • 10
  • 51
  • 83
YD8877
  • 275
  • 1
  • 5
  • 10
  • Impossible to answer without more detailed information, but I think it's unlikely to be the compression... Anyway, voting to migrate to serverfault.com – Pekka Mar 09 '11 at 13:44
  • there is only one way to find out for sure. –  Mar 09 '11 at 13:48

3 Answers3

3

In theory disabling compression should free up the CPU somewhat but it is impossible to say exactly how much. Your best bet would be to use a benchmarking application like ApacheBench or siege and test your server's capabilities with compression enabled and disabled. If your server is under heavy load and can't be easily benchmarked you can try just disabled compression and see if the CPU load changes noticeably (a monitoring application would help here).

Speaking from experience, though, if you're in a situation where you have to disable compression due to high loads you're going to have to look at other solutions as well (bigger server, more servers, different architecture, application optimization, etc...).

uesp
  • 3,384
  • 1
  • 17
  • 16
2

For text / html having gzip is normally a good thing. The question is: What exactly is the perf issue, and is it caused by your application code, or by the gzip overhead?

In our experience, gzip adds approx %1-9 of CPU user, over the CPU use of our app. IOW, the CPU load is all in our app.

Another consideration SSL: If your web server terminates SSL (has ssl cert, etc) this overhead can be considerable. We recently installed SSL certs into our loadbalancer, and CPU use on the web server went down by almost half. (We primarily serve a REST API, so the SSL is rebuilt all the time for transactional conversations.).

Our setup is IIS 6 and IIS 7, fwiw, but the above would apply to any OS.

1

Compression is good for static content (things that haven't been compressed already too, don't try to recompress images and zip files). Compression is generally bad for dynamic content as the overhead eats up any potential gains.

Chris S
  • 77,337
  • 11
  • 120
  • 212