[experimental-ims] bd96df2 Make all three gzip parameter varnish parameters: gzip_level, gzip_window and gzip_memlevel.

Geoff Simmons geoff at varnish-cache.org
Fri Jul 8 11:47:48 CEST 2011


commit bd96df29180f52ccdc399feff9659dd03477d11c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Jun 22 14:28:36 2011 +0000

    Make all three gzip parameter varnish parameters: gzip_level,
    gzip_window and gzip_memlevel.
    
    Still same pessimal values though.

diff --git a/bin/varnishd/cache_gzip.c b/bin/varnishd/cache_gzip.c
index e9ae902..f320a0a 100644
--- a/bin/varnishd/cache_gzip.c
+++ b/bin/varnishd/cache_gzip.c
@@ -202,8 +202,8 @@ VGZ_NewGzip(struct sess *sp, const char *id)
 	i = deflateInit2(&vg->vz,
 	    params->gzip_level,		/* Level */
 	    Z_DEFLATED,			/* Method */
-	    16 + 8,			/* Window bits (16=gzip + 15) */
-	    1,				/* memLevel */
+	    16 + params->gzip_window,	/* Window bits (16=gzip + 15) */
+	    params->gzip_memlevel,	/* memLevel */
 	    Z_DEFAULT_STRATEGY);
 	if (i != Z_OK)
 		printf("deflateInit2() = %d\n", i);
diff --git a/bin/varnishd/heritage.h b/bin/varnishd/heritage.h
index 16828ed..084d5dc 100644
--- a/bin/varnishd/heritage.h
+++ b/bin/varnishd/heritage.h
@@ -204,6 +204,8 @@ struct params {
 	unsigned		gzip_stack_buffer;
 	unsigned		gzip_tmp_space;
 	unsigned		gzip_level;
+	unsigned		gzip_window;
+	unsigned		gzip_memlevel;
 
 	double			critbit_cooloff;
 
diff --git a/bin/varnishd/mgt_param.c b/bin/varnishd/mgt_param.c
index 1caa563..1b996e5 100644
--- a/bin/varnishd/mgt_param.c
+++ b/bin/varnishd/mgt_param.c
@@ -887,6 +887,14 @@ static const struct parspec input_parspec[] = {
 		"Gzip compression level: 0=debug, 1=fast, 9=best",
 		0,
 		"6", ""},
+	{ "gzip_window", tweak_uint, &master.gzip_window, 8, 15,
+		"Gzip window size 8=least, 15=most compression",
+		0,
+		"8", ""},
+	{ "gzip_window", tweak_uint, &master.gzip_memlevel, 1, 9,
+		"Gzip memory level 1=least, 9=most compression",
+		0,
+		"1", ""},
 	{ "gzip_stack_buffer", tweak_uint, &master.gzip_stack_buffer,
 	        2048, UINT_MAX,
 		"Size of stack buffer used for gzip processing.\n"



More information about the varnish-commit mailing list