src/http/modules/ngx_http_gzip_filter_module.c tuning

Igor Sysoev is at rambler-co.ru
Sun Dec 10 13:04:58 MSK 2006


On Sun, 10 Dec 2006, Aleksandar Lazic wrote:

> today I have tested nginx and apache compression behavior with proxied
> requests and wasn't very happy that apache beats nginx :-/
>
> /usr/sbin/ab2 -t 60 -c 5 -H 'Accept-Encoding: gzip' URL
>
> Server Software:        nginx/0.5.0 (with compression level 2)
> Requests per second:    17.70 [#/sec] (mean)
>
> Server Software:        Apache with deflate output filter
> Requests per second:    20.16 [#/sec] (mean)
>
> Without compression nginx beats apache, with the same proxied request
> ;-):
>
> /usr/sbin/ab2 -t 60 -c 5 SAME_URL
>
> Server Software:        nginx/0.5.0
> Requests per second:    12.63 [#/sec] (mean)
>
> Server Software:        Apache with deflate output filter
> Requests per second:    11.26 [#/sec] (mean)
>
> nginx.conf [snipped]
> ---
> gzip on;
> gzip_types   text/plain text/css application/x-javascript text/xml;
> gzip_proxied any;
> gzip_comp_level 2;
> proxy_buffering off;
> ---
>
> Default apache conf from 'make install'.
>
> How can I tune the gzip filter module to come to apache req/s, if it's
> possible?!
>
> I have seen some options in the src which I haven't found in the doc:
>
> gzip_no_buffer?
> gzip_window?
> gzip_hash?
>
> Could this help?!

What backend do you use ?

There may be follwoing reasons:

1) by default nginx compresses 1.1 requests only, you may set:
    gzip_http_version 1.0
    if ab2 sends 1.0 requests then nginx pass them to backend and
    backend compresses them.

2) how many CPUs and hao many worker_processes ?

3) instead of "proxy_buffering off" better use
    proxy_max_temp_file_size  0;


Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list