Apache benchmark load-test: mod_deflate enabled vs disabled
Asked Answered
F

2

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

Fairground answered 10/6, 2011 at 10:58 Comment(0)
C
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/"
Chromatic answered 10/6, 2011 at 15:3 Comment(0)
H
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.

Hypochondriasis answered 10/6, 2011 at 11:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.