luca
luca

Reputation: 37136

Apache benchmark load-test: mod_deflate enabled vs disabled

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

Please explain me

thanks

Luca

Upvotes: 5

Views: 3354

Answers (2)

rightstuff
rightstuff

Reputation: 6522

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/"

Upvotes: 7

KingCrunch
KingCrunch

Reputation: 131841

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.

Upvotes: 0

Related Questions