Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#882 Support nginx $gzip_ratio

open
nobody
None
1
3 days ago
2014-02-07
rhi
No

AWStats currently supports these gzip/deflate field formats:

%gzipin mod_gzip compression input bytes: In:XXX
%gzipout mod_gzip compression output bytes & ratio: Out:YYY:ZZpct.
%gzipratio mod_gzip compression ratio: ZZpct.
%deflateratio mod_deflate compression ratio with format: (ZZ)

However, nginx only provides:

$gzip_ratio – achieved compression ratio, computed as the ratio between the original and compressed response sizes.

For instance, a log entry like

my.vhost ip.address - [07/Feb/2014:20:51:40 +0100] "GET /my-url HTTP/1.1" 200 3021 "-" "Mozilla/5.0 (WhatsMyIP.org HTTP_Compression_Test) whatsmyip.org/ua" 2.96

means:

Uncompressed Page Size: 8.7 KB
Compressed Page Size: 2.9 KB
Savings: 66.2%

So the gzip_ratio = uncompressed/compressed = 8.7/2.9 = 2.96

Please provide this ratio as an AWStats field so that nginx gzip compression can be analyzed correctly.

Discussion