]> err.no Git - varnish/commitdiff
Make the size of the workerthreads local shmlog workspace a paramter.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 10 Sep 2008 12:08:56 +0000 (12:08 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 10 Sep 2008 12:08:56 +0000 (12:08 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3176 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_pool.c
varnish-cache/bin/varnishd/heritage.h
varnish-cache/bin/varnishd/mgt_param.c

index c12825a0642f3f88de4cf99448729383ec1a8a48..be5a031f4b9e3ed33b9b39e95fb7ddb8061399c4 100644 (file)
@@ -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");
index f4490179db96a5830fa24717fa37427b50f9f187..80c1c3a7c2678b9f0c62a316f492778bc33f36c8 100644 (file)
@@ -96,6 +96,7 @@ struct params {
        /* Memory allocation hints */
        unsigned                sess_workspace;
        unsigned                obj_workspace;
+       unsigned                shm_workspace;
 
        /* Acceptor hints */
        unsigned                sess_timeout;
index 68983863fca38f329e974d7e35e3b71ead4e569b..8629b77858b39db96bd6353a4f2f680ee65693f4 100644 (file)
@@ -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 "