From 069eeedba5a6503a8893e29334323e822d8869a2 Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 21 Sep 2007 13:18:10 +0000 Subject: [PATCH] Add an experimental runtime parameter for the lru_timeout. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1979 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/heritage.h | 3 +++ varnish-cache/bin/varnishd/mgt_param.c | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/varnish-cache/bin/varnishd/heritage.h b/varnish-cache/bin/varnishd/heritage.h index a30e607e..b0e9f8a8 100644 --- a/varnish-cache/bin/varnishd/heritage.h +++ b/varnish-cache/bin/varnishd/heritage.h @@ -120,6 +120,9 @@ struct params { /* Ping interval */ unsigned ping_interval; + /* LRU list ordering interval */ + unsigned lru_timeout; + }; extern volatile struct params *params; diff --git a/varnish-cache/bin/varnishd/mgt_param.c b/varnish-cache/bin/varnishd/mgt_param.c index 466089c8..b50556f6 100644 --- a/varnish-cache/bin/varnishd/mgt_param.c +++ b/varnish-cache/bin/varnishd/mgt_param.c @@ -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" -- 2.39.5