From e96301281a6b6a7cc7c30cc7c3dc90d33f626c89 Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 10 Sep 2008 12:08:56 +0000 Subject: [PATCH] Make the size of the workerthreads local shmlog workspace a paramter. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3176 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_pool.c | 2 +- varnish-cache/bin/varnishd/heritage.h | 1 + varnish-cache/bin/varnishd/mgt_param.c | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_pool.c b/varnish-cache/bin/varnishd/cache_pool.c index c12825a0..be5a031f 100644 --- a/varnish-cache/bin/varnishd/cache_pool.c +++ b/varnish-cache/bin/varnishd/cache_pool.c @@ -237,7 +237,7 @@ wrk_thread(void *priv) { struct worker *w, ww; struct wq *qp; - unsigned char wlog[8192]; /* XXX: size */ + unsigned char wlog[params->shm_workspace]; struct workreq *wrq; THR_SetName("cache-worker"); diff --git a/varnish-cache/bin/varnishd/heritage.h b/varnish-cache/bin/varnishd/heritage.h index f4490179..80c1c3a7 100644 --- a/varnish-cache/bin/varnishd/heritage.h +++ b/varnish-cache/bin/varnishd/heritage.h @@ -96,6 +96,7 @@ struct params { /* Memory allocation hints */ unsigned sess_workspace; unsigned obj_workspace; + unsigned shm_workspace; /* Acceptor hints */ unsigned sess_timeout; diff --git a/varnish-cache/bin/varnishd/mgt_param.c b/varnish-cache/bin/varnishd/mgt_param.c index 68983863..8629b778 100644 --- a/varnish-cache/bin/varnishd/mgt_param.c +++ b/varnish-cache/bin/varnishd/mgt_param.c @@ -595,6 +595,15 @@ static const struct parspec parspec[] = { "Minimum is 1024 bytes.", DELAYED_EFFECT, "8192", "bytes" }, + { "shm_workspace", tweak_uint, &master.shm_workspace, 4096, UINT_MAX, + "Bytes of shmlog workspace allocated for worker threads. " + "If too big, it wastes some ram, if too small it causes " + "needless flushes of the SHM workspace.\n" + "These flushes show up in stats as " + "\"SHM flushes due to overflow\".\n" + "Minimum is 4096 bytes.", + DELAYED_EFFECT, + "8192", "bytes" }, { "default_grace", tweak_uint, &master.default_grace, 0, UINT_MAX, "Default grace period. We will deliver an object " "this long after it has expired, provided another thread " -- 2.39.5