5

I'm running a simple load test with apache benchmark:

ab -n 1 http://localhost/mysite/index/index/

I want to see performance with/without mod_deflate

In my httpd.conf:

#mod_deflate enabled
LoadModule deflate_module modules/mod_deflate.so
#mod_deflate disabled
#LoadModule deflate_module modules/mod_deflate.so 

enter image description here

  • It looks like server without mod_deflate is performing better than with mod_deflate enabled (see "time taken for tests","Requests per seconds" and "time per requests").

  • Plus I dont understand why total transferred is bigger with deflate enabled

Please explain me

thanks

Luca

luca
  • 36,606
  • 27
  • 86
  • 125

2 Answers2

7

apachebench (ab.exe) will run without compression enabled by default.

To enable compression you have to add an additional header to the request.

ab -n 1 -H "Accept-Encoding: gzip,deflate" "http://localhost/mysite/index/index/"
rightstuff
  • 6,412
  • 31
  • 20
0

This hardly depends what is transferred. If you just send a simple "Hello world" the overhead of the compression may be bigger, than the compressed content itself. The bigger the payload is, the better a compression can work. In your example I see 7kB data, which also contains the http headers, that cannot get compressed (at least because there is mentioned, that the data is compressed an how ;)).

Also note, that a "benchmark", with one sample is nearly useless (especially with such a small sample size). Once again in your example I see not one better and one worse request, I see two nearly identical request. The difference is negligible.

KingCrunch
  • 128,817
  • 21
  • 151
  • 173