I've kicked some of the health code out of cache_center.c
Poul-Henning Kamp
phk at phk.freebsd.dk
Sun Sep 30 22:27:17 CEST 2007
Hi Cecilie,
I have kicked some of the backend health code out of cache_center.c,
you cannot implement a backend timeout function by monitoring cache-hits.
You must either start a thread in the backend policy to do these timeouts,
or calculate them on demand when requests come into the policy methods.
I will also argue that having backend->health as an integer variable
deprives you of a good chance to calculate the number on the fly
when the VCL code asks for it, so I would suggest we eliminate the
fields:
int health;
double last_check;
int minute_limit;
and push them into the private part of the backend policy, and add
another function
VBE_GetHealth()
which
VRT_r_backend_health()
uses to get the health metric.
I centralized all the UpdateHealth calls in cache_fetch.c and changed
the reporting to be the response code or a negative failure code, then
each backend policy can interpret these as it likes.
We should probably also monitor the backend responsetime, but I would
sugges we don't start to play with that, until we have the simple
stuff working.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the varnish-commit
mailing list