]> err.no Git - varnish/commitdiff
Add an experimental runtime parameter for the lru_timeout.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 21 Sep 2007 13:18:10 +0000 (13:18 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 21 Sep 2007 13:18:10 +0000 (13:18 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1979 d4fa192b-c00b-0410-8231-f00ffab90ce4

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

index a30e607eeebffe4872bd1311f9f12e3e8167b479..b0e9f8a8122538db67f88ad5272683020904c1e3 100644 (file)
@@ -120,6 +120,9 @@ struct params {
        /* Ping interval */
        unsigned                ping_interval;
 
+       /* LRU list ordering interval */
+       unsigned                lru_timeout;
+
 };
 
 extern volatile struct params *params;
index 466089c8124bdadd383d2c7d5e63018c7a96f719..b50556f670ea9fd97c1eeb05d7a90df2ce57a132 100644 (file)
@@ -327,6 +327,15 @@ tweak_send_timeout(struct cli *cli, struct parspec *par, const char *arg)
 
 /*--------------------------------------------------------------------*/
 
+static void
+tweak_lru_timeout(struct cli *cli, struct parspec *par, const char *arg)
+{
+       (void)par;
+       tweak_generic_timeout(cli, &master.lru_timeout, arg);
+}
+
+/*--------------------------------------------------------------------*/
+
 static void
 tweak_auto_restart(struct cli *cli, struct parspec *par, const char *arg)
 {
@@ -716,6 +725,14 @@ static struct parspec parspec[] = {
                "it possible to attach a debugger to the child.\n"
                MUST_RESTART,
                "3", "seconds" },
+       { "lru_interval", tweak_lru_timeout,
+               "Grace period before object moves on LRU list.\n"
+               "Objects are only moved to the front of the LRU "
+               "list if they have not been moved there already inside "
+               "this timeout period.  This reduces the amount of lock "
+               "operations necessary for LRU list access.\n"
+               EXPERIMENTAL,
+               "2", "seconds" },
        { "cc_command", tweak_cc_command,
                "Command used for compiling the C source code to a "
                "dlopen(3) loadable object.\n"