[master] 0fe2834 Introduce a storage backend type (stevedore) 'default' which resolves to umem or malloc

Nils Goroll nils.goroll at uplex.de
Thu Sep 28 10:31:07 UTC 2017


commit 0fe283433ae2eb4509f3625c9dbb7e018a654293
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Sep 26 16:49:28 2017 +0200

    Introduce a storage backend type (stevedore) 'default' which resolves to umem or malloc
    
    On platforms where umem is available (specifically Solaris descendents), we want
    to make umem the default allocator for performance reasons and also for vtc coverage
    while still keeping the malloc type as fallback option.

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index dd340db..aa1bb74 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -127,7 +127,10 @@ usage(void)
 	printf(FMT, "-s [name=]kind[,options]", "Storage specification");
 	printf(FMT, "", "Can be specified multiple times.");
 #ifdef HAVE_LIBUMEM
+	printf(FMT, "", "  -s default (=umem)");
 	printf(FMT, "", "  -s umem");
+#else
+	printf(FMT, "", "  -s default (=malloc)");
 #endif
 	printf(FMT, "", "  -s malloc");
 	printf(FMT, "", "  -s file");
@@ -437,7 +440,7 @@ main(int argc, char * const *argv)
 	const char *n_arg = NULL;
 	const char *P_arg = NULL;
 	const char *S_arg = NULL;
-	const char *s_arg = "malloc,100m";
+	const char *s_arg = "default,100m";
 	const char *W_arg = NULL;
 	int s_arg_given = 0;
 	int novcl = 0;
diff --git a/bin/varnishd/storage/mgt_stevedore.c b/bin/varnishd/storage/mgt_stevedore.c
index 71324a5..ef44695 100644
--- a/bin/varnishd/storage/mgt_stevedore.c
+++ b/bin/varnishd/storage/mgt_stevedore.c
@@ -124,6 +124,9 @@ static const struct choice STV_choice[] = {
 	{ "persistent",			&smp_fake_stevedore },
 #if defined(HAVE_LIBUMEM)
 	{ "umem",			&smu_stevedore },
+	{ "default",			&smu_stevedore },
+#else
+	{ "default",			&sma_stevedore },
 #endif
 	{ NULL,		NULL }
 };
@@ -217,7 +220,7 @@ STV_Config_Transient(void)
 
 	VCLS_AddFunc(mgt_cls, MCF_AUTH, cli_stv);
 	if (stv_transient == NULL)
-		STV_Config(TRANSIENT_STORAGE "=malloc");
+		STV_Config(TRANSIENT_STORAGE "=default");
 	AN(stv_transient);
 	VTAILQ_INSERT_TAIL(&stevedores, stv_transient, list);
 }
diff --git a/bin/varnishtest/tests/b00002.vtc b/bin/varnishtest/tests/b00002.vtc
index f56fae0..26591b0 100644
--- a/bin/varnishtest/tests/b00002.vtc
+++ b/bin/varnishtest/tests/b00002.vtc
@@ -5,7 +5,7 @@ server s1 {
 	txresp -hdr "Cache-Control: max-age=120" -hdr "Connection: close" -body "012345\n"
 } -start
 
-varnish v1 -vcl+backend {
+varnish v1 -arg "-sTransient=default,1m" -vcl+backend {
 	sub vcl_recv {
 		return(pass);
 	}
diff --git a/bin/varnishtest/tests/b00006.vtc b/bin/varnishtest/tests/b00006.vtc
index b7d1c8b..c89915b 100644
--- a/bin/varnishtest/tests/b00006.vtc
+++ b/bin/varnishtest/tests/b00006.vtc
@@ -1,11 +1,11 @@
-varnishtest "Check that -s malloc works"
+varnishtest "Check that -s default works"
 
 server s1 {
 	rxreq
 	txresp -hdr "Connection: close" -body "012345\n"
 } -start
 
-varnish v1 -arg "-s malloc" -vcl+backend {} -start
+varnish v1 -arg "-s default" -vcl+backend {} -start
 
 client c1 {
 	txreq -url "/"
diff --git a/bin/varnishtest/tests/c00018.vtc b/bin/varnishtest/tests/c00018.vtc
index f61b6c5..96368b9 100644
--- a/bin/varnishtest/tests/c00018.vtc
+++ b/bin/varnishtest/tests/c00018.vtc
@@ -91,7 +91,7 @@ logexpect l1 -v v1 -g raw {
 	expect 0 1007	VCL_call        {^PASS$}
 	expect 0 1007	VCL_return      {^fetch$}
 	expect 0 1007	Link            {^bereq 1008 pass$}
-	expect 0 1007	Storage         {^malloc Transient$}
+	expect 0 1007	Storage         {^(malloc|umem) Transient$}
 	expect 0 1007	RespProtocol    {^HTTP/1.1$}
 	expect 0 1007	RespStatus      {^100$}
 	expect 0 1007	RespReason      {^Continue$}
@@ -107,7 +107,7 @@ logexpect l1 -v v1 -g raw {
 	expect 0 1009	ReqHeader       {^Content-Length: 20$}
 	expect 0 1009	ReqHeader       {^X-Forwarded-For:}
 	expect 0 1009	VCL_call        {^RECV$}
-	expect 0 1009	Storage         {^malloc Transient$}
+	expect 0 1009	Storage         {^(malloc|umem) Transient$}
 	expect 0 1009	RespProtocol    {^HTTP/1.1$}
 	expect 0 1009	RespStatus      {^100$}
 	expect 0 1009	RespReason      {^Continue$}
diff --git a/bin/varnishtest/tests/c00027.vtc b/bin/varnishtest/tests/c00027.vtc
index d9c7e8e..5c22daf 100644
--- a/bin/varnishtest/tests/c00027.vtc
+++ b/bin/varnishtest/tests/c00027.vtc
@@ -18,7 +18,7 @@ server s1 {
 	txresp -body "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
 } -start
 
-varnish v1 -arg "-s malloc,1M" -vcl+backend {
+varnish v1 -arg "-s default,1M" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.ttl = 10m;
 	}
diff --git a/bin/varnishtest/tests/c00044.vtc b/bin/varnishtest/tests/c00044.vtc
index f9ebad6..5701cf4 100644
--- a/bin/varnishtest/tests/c00044.vtc
+++ b/bin/varnishtest/tests/c00044.vtc
@@ -18,9 +18,10 @@ server s1 {
 } -start
 
 varnish v1 \
-	-arg "-ss1=malloc,1m" \
-	-arg "-ss2=malloc,1m" \
-	-arg "-ss0=malloc,1m" \
+	-arg "-ss1=default,1m" \
+	-arg "-ss2=default,1m" \
+	-arg "-ss0=default,1m" \
+	-arg "-sTransient=default" \
 	-vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_stream = false;
diff --git a/bin/varnishtest/tests/c00045.vtc b/bin/varnishtest/tests/c00045.vtc
index 96fb58a..896a520 100644
--- a/bin/varnishtest/tests/c00045.vtc
+++ b/bin/varnishtest/tests/c00045.vtc
@@ -10,9 +10,10 @@ server s1 {
 } -start
 
 varnish v1 \
-	-arg "-smalloc,1m" \
-	-arg "-smalloc,1m" \
-	-arg "-smalloc,1m" \
+	-arg "-sdefault,1m" \
+	-arg "-sdefault,1m" \
+	-arg "-sdefault,1m" \
+	-arg "-sTransient=default" \
 	-vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_stream = false;
diff --git a/bin/varnishtest/tests/c00046.vtc b/bin/varnishtest/tests/c00046.vtc
index 3666ed8..55832f3 100644
--- a/bin/varnishtest/tests/c00046.vtc
+++ b/bin/varnishtest/tests/c00046.vtc
@@ -6,9 +6,10 @@ server s1 {
 } -start
 
 varnish v1 \
-	-arg "-smalloc,1m" \
-	-arg "-smalloc,1m" \
-	-arg "-smalloc,1m" \
+	-arg "-sdefault,1m" \
+	-arg "-sdefault,1m" \
+	-arg "-sdefault,1m" \
+	-arg "-sTransient=default" \
 	-vcl+backend {
 	sub vcl_backend_response {
 		set beresp.storage = storage.s0;
diff --git a/bin/varnishtest/tests/c00073.vtc b/bin/varnishtest/tests/c00073.vtc
index 78cfabb..812ac98 100644
--- a/bin/varnishtest/tests/c00073.vtc
+++ b/bin/varnishtest/tests/c00073.vtc
@@ -14,7 +14,7 @@ server s1 {
 } -start
 
 varnish v1 \
-	-arg "-s malloc,1m" -vcl+backend { } -start
+	-arg "-s default,1m" -vcl+backend { } -start
 
 client c1 {
 	txreq
diff --git a/bin/varnishtest/tests/c00075.vtc b/bin/varnishtest/tests/c00075.vtc
index ab87fbc..6cafdde 100644
--- a/bin/varnishtest/tests/c00075.vtc
+++ b/bin/varnishtest/tests/c00075.vtc
@@ -8,7 +8,7 @@ server s1 {
 } -start
 
 varnish v1 \
-	-arg "-s malloc,1m" -vcl+backend { } -start
+	-arg "-s default,1m" -vcl+backend { } -start
 
 varnish v1 -cliok "debug.fragfetch 1024"
 
diff --git a/bin/varnishtest/tests/c00078.vtc b/bin/varnishtest/tests/c00078.vtc
index 613b971..b1fcc60 100644
--- a/bin/varnishtest/tests/c00078.vtc
+++ b/bin/varnishtest/tests/c00078.vtc
@@ -6,9 +6,9 @@ server s1 -repeat 6 {
 } -start
 
 varnish v1 \
-    -arg "-ss1=malloc,1m" \
-    -arg "-ss2=malloc,1m" \
-    -arg "-ss0=malloc,1m" \
+    -arg "-ss1=default,1m" \
+    -arg "-ss2=default,1m" \
+    -arg "-ss0=default,1m" \
     -vcl+backend {
 	import vtc;
 	sub vcl_backend_response {
diff --git a/bin/varnishtest/tests/c00084.vtc b/bin/varnishtest/tests/c00084.vtc
index 6ec8dee..3a4c77c 100644
--- a/bin/varnishtest/tests/c00084.vtc
+++ b/bin/varnishtest/tests/c00084.vtc
@@ -1,6 +1,6 @@
 varnishtest "legal symbol names"
 
-varnish v1 -arg "-s my-store=malloc" -vcl {
+varnish v1 -arg "-s my-store=default" -vcl {
 	import directors;
 
 	acl my-acl { "127.0.0.1"; }
diff --git a/bin/varnishtest/tests/e00007.vtc b/bin/varnishtest/tests/e00007.vtc
index 635f19e..015ffbb 100644
--- a/bin/varnishtest/tests/e00007.vtc
+++ b/bin/varnishtest/tests/e00007.vtc
@@ -31,7 +31,7 @@ server s1 {
 	}
 } -start
 
-varnish v1 -arg "-smalloc,2m" -vcl+backend {
+varnish v1 -arg "-sdefault,2m" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_esi = true;
 	}
diff --git a/bin/varnishtest/tests/g00002.vtc b/bin/varnishtest/tests/g00002.vtc
index c440a23..30b05ad 100644
--- a/bin/varnishtest/tests/g00002.vtc
+++ b/bin/varnishtest/tests/g00002.vtc
@@ -12,7 +12,7 @@ server s1 {
 } -start
 
 varnish v1 \
-	-arg "-smalloc,2m" \
+	-arg "-sdefault,2m" \
 	-cliok "param.set http_gzip_support true" \
 	-cliok "param.set gzip_memlevel 1" \
 	-vcl+backend {
diff --git a/bin/varnishtest/tests/r00776.vtc b/bin/varnishtest/tests/r00776.vtc
index 530168d..59e5f65 100644
--- a/bin/varnishtest/tests/r00776.vtc
+++ b/bin/varnishtest/tests/r00776.vtc
@@ -9,7 +9,7 @@ server s1 {
 
 varnish v1 \
 	-arg "-p fetch_chunksize=4k" \
-	-arg "-s malloc,1m" -vcl+backend { } -start
+	-arg "-s default,1m" -vcl+backend { } -start
 
 client c1 {
 	txreq
diff --git a/bin/varnishtest/tests/r01036.vtc b/bin/varnishtest/tests/r01036.vtc
index 97c68e8..94a13ef 100644
--- a/bin/varnishtest/tests/r01036.vtc
+++ b/bin/varnishtest/tests/r01036.vtc
@@ -7,7 +7,7 @@ server s1 {
 	txresp -bodylen 1572864
 } -start
 
-varnish v1 -arg "-smalloc,1M" -arg "-pgzip_level=0" -vcl+backend {
+varnish v1 -arg "-sdefault,1M" -arg "-pgzip_level=0" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_stream = false;
 		set beresp.do_gzip = true;
diff --git a/bin/varnishtest/tests/r01037.vtc b/bin/varnishtest/tests/r01037.vtc
index 6bf8a3c..066d1e2 100644
--- a/bin/varnishtest/tests/r01037.vtc
+++ b/bin/varnishtest/tests/r01037.vtc
@@ -14,7 +14,7 @@ server s1 {
 	chunkedlen 0
 } -start
 
-varnish v1 -arg "-smalloc,1M" -arg "-pgzip_level=0" -vcl+backend {
+varnish v1 -arg "-sdefault,1M" -arg "-pgzip_level=0" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_esi = true;
 		set beresp.do_gzip = true;
diff --git a/bin/varnishtest/tests/r01140.vtc b/bin/varnishtest/tests/r01140.vtc
index 994107c..1c9bd49 100644
--- a/bin/varnishtest/tests/r01140.vtc
+++ b/bin/varnishtest/tests/r01140.vtc
@@ -19,7 +19,7 @@ server s1 {
 } -start
 
 varnish v1 -arg "-p nuke_limit=0 -p shortlived=0" \
-	-arg "-smalloc,1m" -vcl+backend {
+	-arg "-sdefault,1m" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_stream = false;
 		# Unset Date header to not change the object sizes
diff --git a/bin/varnishtest/tests/r01175.vtc b/bin/varnishtest/tests/r01175.vtc
index 72661d9..5b7a748 100644
--- a/bin/varnishtest/tests/r01175.vtc
+++ b/bin/varnishtest/tests/r01175.vtc
@@ -1,11 +1,11 @@
-varnishtest "#1175 - -smalloc c_fail incremented by allocations, not bytes"
+varnishtest "#1175 - -sdefault c_fail incremented by allocations, not bytes"
 
 server s1 {
 	rxreq
 	txresp -nolen -hdr "Content-Length: 1048576"
 } -start
 
-varnish v1 -arg "-s test=malloc,1M" -vcl+backend {
+varnish v1 -arg "-s test=default,1M" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.storage = storage.test;
 		set beresp.do_stream = false;
diff --git a/bin/varnishtest/tests/r01176.vtc b/bin/varnishtest/tests/r01176.vtc
index 0af3a5f..0e4df2f 100644
--- a/bin/varnishtest/tests/r01176.vtc
+++ b/bin/varnishtest/tests/r01176.vtc
@@ -1,11 +1,11 @@
-varnishtest "-s Transient=malloc crash"
+varnishtest "-s Transient=default crash"
 
 server s1 {
 	rxreq
 	txresp
 } -start
 
-varnish v1 -arg "-s Transient=malloc" -vcl+backend {} -start
+varnish v1 -arg "-s Transient=default" -vcl+backend {} -start
 
 client c1 {
 	txreq
diff --git a/bin/varnishtest/tests/r01284.vtc b/bin/varnishtest/tests/r01284.vtc
index f4d5efb..5612acb 100644
--- a/bin/varnishtest/tests/r01284.vtc
+++ b/bin/varnishtest/tests/r01284.vtc
@@ -11,7 +11,7 @@ server s1 {
 
 varnish v1 \
 	-arg "-p nuke_limit=0" \
-	-arg "-sTransient=malloc,1m" \
+	-arg "-sTransient=default,1m" \
 	-vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_stream = false;
diff --git a/bin/varnishtest/tests/r01637.vtc b/bin/varnishtest/tests/r01637.vtc
index 1c7489c..ee0093b 100644
--- a/bin/varnishtest/tests/r01637.vtc
+++ b/bin/varnishtest/tests/r01637.vtc
@@ -23,7 +23,7 @@ server s1 {
 	txresp -bodylen 9000
 } -start
 
-varnish v1  -arg "-smalloc,1M" -arg "-p nuke_limit=0 -p gzip_level=0" \
+varnish v1  -arg "-sdefault,1M" -arg "-p nuke_limit=0 -p gzip_level=0" \
     -vcl+backend {
 	sub vcl_backend_response {
 		if (bereq.url == "/url5") {
diff --git a/bin/varnishtest/tests/r01764.vtc b/bin/varnishtest/tests/r01764.vtc
index e5b8211..9f4e4cf 100644
--- a/bin/varnishtest/tests/r01764.vtc
+++ b/bin/varnishtest/tests/r01764.vtc
@@ -24,7 +24,7 @@ server s1 {
 	txresp -bodylen 1000000
 } -start
 
-varnish v1  -arg "-smalloc,1M" -arg "-p nuke_limit=1" -vcl+backend {
+varnish v1  -arg "-sdefault,1M" -arg "-p nuke_limit=1" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_stream = false;
 	}
diff --git a/bin/varnishtest/tests/r01821.vtc b/bin/varnishtest/tests/r01821.vtc
index 3c7c02c..af6e934 100644
--- a/bin/varnishtest/tests/r01821.vtc
+++ b/bin/varnishtest/tests/r01821.vtc
@@ -5,7 +5,7 @@ server s1 -repeat 2 {
 	txresp -bodylen 65535
 } -start
 
-varnish v1 -vcl+backend {
+varnish v1 -arg "-s Transient=default" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.uncacheable = true;
 	}
diff --git a/bin/varnishtest/tests/r01914.vtc b/bin/varnishtest/tests/r01914.vtc
index b6a9269..d7f1b20 100644
--- a/bin/varnishtest/tests/r01914.vtc
+++ b/bin/varnishtest/tests/r01914.vtc
@@ -9,7 +9,11 @@ server s1 {
 	txresp
 } -start
 
-varnish v1 -arg "-s malloc,1MB" -arg "-s malloc,1MB" -vcl+backend {
+varnish v1 \
+    -arg "-s default,1MB" \
+    -arg "-s default,1MB" \
+    -arg "-s Transient=default" \
+    -vcl+backend {
 	import std;
 	sub vcl_recv {
 		if (req.url == "/1") {
diff --git a/bin/varnishtest/tests/r01941.vtc b/bin/varnishtest/tests/r01941.vtc
index 188125c..79f21c9 100644
--- a/bin/varnishtest/tests/r01941.vtc
+++ b/bin/varnishtest/tests/r01941.vtc
@@ -24,7 +24,7 @@ server s1 {
 } -start
 
 varnish v1 -arg "-pfetch_chunksize=4k" \
-	-arg "-smalloc,1m" -vcl+backend {
+	-arg "-sdefault,1m" -vcl+backend {
 	sub vcl_backend_response {
 		set beresp.do_esi = true;
 	}
diff --git a/bin/varnishtest/tests/r02321.vtc b/bin/varnishtest/tests/r02321.vtc
index 33c7658..1596456 100644
--- a/bin/varnishtest/tests/r02321.vtc
+++ b/bin/varnishtest/tests/r02321.vtc
@@ -1,19 +1,19 @@
 varnishtest "Storage name collisions"
 
 # intentional collision
-shell -err -expect "Error: (-s main=malloc,100m) 'main' is already defined" {
+shell -err -expect "Error: (-s main=default,100m) 'main' is already defined" {
 	exec varnishd -a :0 -f '' -n ${tmpdir} \
-		-s main=malloc,10m -s main=malloc,100m
+		-s main=default,10m -s main=default,100m
 }
 
 # pseudo-accidental collision
-shell -err -expect "Error: (-s s0=malloc,100m) 's0' is already defined" {
+shell -err -expect "Error: (-s s0=default,100m) 's0' is already defined" {
 	exec varnishd -a :0 -f '' -n ${tmpdir} \
-		-s malloc,10m -s s0=malloc,100m
+		-s default,10m -s s0=default,100m
 }
 
 # Transient collision
-shell -err -expect "Error: (-s Transient=malloc,100m) 'Transient' is already defined" {
+shell -err -expect "Error: (-s Transient=default,100m) 'Transient' is already defined" {
 	exec varnishd -a :0 -f '' -n ${tmpdir} \
-		-s Transient=malloc,10m -s Transient=malloc,100m
+		-s Transient=default,10m -s Transient=default,100m
 }
diff --git a/bin/varnishtest/tests/r02325.vtc b/bin/varnishtest/tests/r02325.vtc
index 7b357e5..fab645a 100644
--- a/bin/varnishtest/tests/r02325.vtc
+++ b/bin/varnishtest/tests/r02325.vtc
@@ -1,7 +1,7 @@
 varnishtest "validate storage identifiers"
 
 shell -err -expect {Error: invalid -s name "///"=[...]} {
-	varnishd -a :0 -n ${tmpdir} -F -f '' -s ///=malloc
+	varnishd -a :0 -n ${tmpdir} -F -f '' -s ///=default
 }
 shell -err -expect {Error: Empty named -s argument "foo="} {
 	varnishd -a :0 -n ${tmpdir} -F -f '' -s foo=
diff --git a/bin/varnishtest/tests/r02406.vtc b/bin/varnishtest/tests/r02406.vtc
index 05ad838..68068db 100644
--- a/bin/varnishtest/tests/r02406.vtc
+++ b/bin/varnishtest/tests/r02406.vtc
@@ -1,6 +1,6 @@
 varnishtest "Long backend and storage names"
 
-varnish v1 -arg "-s acme_example_com_static_assets_malloc_storage=malloc"
+varnish v1 -arg "-s acme_example_com_static_assets_default_storage=default"
 
 varnish v1 -vcl {
 	backend be_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789 {
@@ -8,5 +8,5 @@ varnish v1 -vcl {
 	}
 } -start
 
-varnish v1 -expect SM?.acme_example_com_static_assets_malloc_storage.c_req == 0
+varnish v1 -expect SM?.acme_example_com_static_assets_default_storage.c_req == 0
 varnish v1 -expect VBE.vcl1.be_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789_0123456789.req == 0
diff --git a/bin/varnishtest/tests/v00010.vtc b/bin/varnishtest/tests/v00010.vtc
index d6b1996..71fa666 100644
--- a/bin/varnishtest/tests/v00010.vtc
+++ b/bin/varnishtest/tests/v00010.vtc
@@ -24,7 +24,7 @@ server s1 {
 	txresp -hdr "Foo: foo" -body "abcdef\n"
 } -start
 
-varnish v1 -arg "-smalloc,1m" -vcl+backend {
+varnish v1 -arg "-sdefault,1m" -vcl+backend {
 	import vtc;
 
 	sub vcl_backend_response {
diff --git a/doc/sphinx/reference/varnishd.rst b/doc/sphinx/reference/varnishd.rst
index 195a33b..7c31eea 100644
--- a/doc/sphinx/reference/varnishd.rst
+++ b/doc/sphinx/reference/varnishd.rst
@@ -273,10 +273,20 @@ Storage Backend
 
 The following storage types are available:
 
+-s <default[,size]>
+
+  The default storage type resolves to umem where available and malloc
+  otherwise.
+
 -s <malloc[,size]>
 
   malloc is a memory based backend.
 
+-s <umem[,size]>
+
+  umem is a storage backend which is more efficient than malloc on
+  platforms where it is available.
+
 -s <file,path[,size[,granularity[,advice]]]>
 
   The file backend stores data in a file on disk. The file will be
diff --git a/doc/sphinx/tutorial/putting_varnish_on_port_80.rst b/doc/sphinx/tutorial/putting_varnish_on_port_80.rst
index 16d38bc..b1c254b 100644
--- a/doc/sphinx/tutorial/putting_varnish_on_port_80.rst
+++ b/doc/sphinx/tutorial/putting_varnish_on_port_80.rst
@@ -19,7 +19,7 @@ some text that looks like this::
                -T localhost:6082 \
                -f /etc/varnish/default.vcl \
                -S /etc/varnish/secret \
-               -s malloc,256m"
+               -s default,256m"
 
 Change it to::
 
@@ -27,7 +27,7 @@ Change it to::
                -T localhost:6082 \
                -f /etc/varnish/default.vcl \
                -S /etc/varnish/secret \
-               -s malloc,256m"
+               -s default,256m"
 
 Debian (v8+) / Ubuntu (v15.04+)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -40,7 +40,7 @@ Applying changes to the default service is best done by creating a new file
 
   [Service]
   ExecStart=
-  ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
+  ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s default,256m
 
 This will override the ExecStart part of the default configuration shipped
 with Varnish Cache.
diff --git a/doc/sphinx/users-guide/command-line.rst b/doc/sphinx/users-guide/command-line.rst
index ad04c02..3356ea4 100644
--- a/doc/sphinx/users-guide/command-line.rst
+++ b/doc/sphinx/users-guide/command-line.rst
@@ -74,9 +74,9 @@ Other options
 
 Varnish comes with an abundance of useful command line arguments. We recommend that you study them but not necessary use them all, but to get started, the above will be sufficient.
 
-By default Varnish will use 100 megabytes of malloc(3) storage
-for caching objects, if you want to cache more than that, you
-should look at the '-s' argument.
+By default Varnish will use 100 megabytes of virtual memory (malloc(3)
+or libumem(3lib)) storage for caching objects, if you want to cache
+more than that, you should look at the '-s' argument.
 
 .. XXX: 3? benc
 
diff --git a/doc/sphinx/users-guide/storage-backends.rst b/doc/sphinx/users-guide/storage-backends.rst
index 1f04269..a631106 100644
--- a/doc/sphinx/users-guide/storage-backends.rst
+++ b/doc/sphinx/users-guide/storage-backends.rst
@@ -13,6 +13,14 @@ configuration is to use the malloc backend with a limited size. For a
 serious Varnish deployment you probably would want to adjust the storage
 settings.
 
+default
+~~~~~~~
+
+syntax: default[,size]
+
+The default storage backend is an alias to umem, where available, or
+malloc otherwise.
+
 malloc
 ~~~~~~
 
@@ -45,6 +53,24 @@ malloc's performance is bound to memory speed so it is very fast. If
 the dataset is bigger than available memory performance will
 depend on the operating systems ability to page effectively.
 
+umem
+~~~~
+
+syntax: umem[,size]
+
+Umem is a better alternative to the malloc backend where `libumem`_ is
+available. All other configuration aspects are considered equal to
+malloc.
+
+`libumem`_ implements a slab allocator similar to the kernel memory
+allocator used in virtually all modern operating systems and is
+considered more efficient and scalable than classical
+implementations. In particular, `libumem`_ is included in the family
+of OpenSolaris descendent operating systems where jemalloc(3) is not
+commonly available.
+
+.. _libumem: http://dtrace.org/blogs/ahl/2004/07/13/number-11-of-20-libumem/
+
 file
 ~~~~
 


More information about the varnish-commit mailing list