Mailing List Archive

r3176 - trunk/varnish-cache/bin/varnishd
Author: phk
Date: 2008-09-10 14:08:56 +0200 (Wed, 10 Sep 2008)
New Revision: 3176

Modified:
trunk/varnish-cache/bin/varnishd/cache_pool.c
trunk/varnish-cache/bin/varnishd/heritage.h
trunk/varnish-cache/bin/varnishd/mgt_param.c
Log:
Make the size of the workerthreads local shmlog workspace a paramter.



Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c 2008-09-09 09:30:58 UTC (rev 3175)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c 2008-09-10 12:08:56 UTC (rev 3176)
@@ -237,7 +237,7 @@
{
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");

Modified: trunk/varnish-cache/bin/varnishd/heritage.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/heritage.h 2008-09-09 09:30:58 UTC (rev 3175)
+++ trunk/varnish-cache/bin/varnishd/heritage.h 2008-09-10 12:08:56 UTC (rev 3176)
@@ -96,6 +96,7 @@
/* Memory allocation hints */
unsigned sess_workspace;
unsigned obj_workspace;
+ unsigned shm_workspace;

/* Acceptor hints */
unsigned sess_timeout;

Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_param.c 2008-09-09 09:30:58 UTC (rev 3175)
+++ trunk/varnish-cache/bin/varnishd/mgt_param.c 2008-09-10 12:08:56 UTC (rev 3176)
@@ -595,6 +595,15 @@
"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 "