[Varnish] #518: Default backend health right after launch
Varnish
varnish-bugs at projects.linpro.no
Fri Jun 19 08:16:58 CEST 2009
#518: Default backend health right after launch
--------------------+-------------------------------------------------------
Reporter: rts | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: build | Version: trunk
Severity: normal | Resolution:
Keywords: |
--------------------+-------------------------------------------------------
Comment (by kb):
I'll take single-malt scotch instead of cash? :-)
The attached patch creates a backend flag to change the initial health of
backends upon varnishd startup:
{{{
backend foo {
.initial_health = 1;
}
}}}
The backend healthy flag internally is an unsigned int, so I kept the same
type. A value > 0 here will cause this backend to default to healthy.
Also, the initial "Probe" output at startup will note "initially healthy"
if this flag is set.
The backend will immediately go "sick" if a single health check fails*,
until the window is flushed. This seems like the safest way to implement
this option, since a bad host will only receive hits until the first probe
can execute against it, which in my testing was nearly immediate. Healthy
hosts will continue to pass and stay healthy.
I'm not using probed backends in production right now, but I'm running one
instance of the patched version at ~1,000 requests per second (at 8% of a
single 2.5G Xeon) and it's stable. YMMV, protect yourself, etc.
I thought about having this flag apply to the director, and backends would
inherit this central flag... but while setting this for every backend in
the config is a little verbose, it just seems cleaner, conceptually. And
a per-backend setting seems cleaner and more flexible than a command-line
flag.
TODO: I should probably add "-p initial_health=1", as it fits the defaults
like between_bytes_timeout.
Comments? Thoughts?
--
Ken.
*(I'm marking the "oldest" .threshold probes in the .window as "pass" and
the others "fail", so a single probe fail will cause sickness until the
window has flushed. The BITMAP()/vt->happy stuff in
bin/varnishd/cache_backend_poll.[ch] made my face bleed, but look there
for specifics of the implementation.)
--
Ticket URL: <http://varnish.projects.linpro.no/ticket/518#comment:4>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list