[Varnish] #1658: Hash and Random director is deflected at the health-check failover
Varnish
varnish-bugs at varnish-cache.org
Mon Jan 12 15:17:50 CET 2015
#1658: Hash and Random director is deflected at the health-check failover
--------------------+--------------------
Reporter: xcir | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: vmod | Version: trunk
Severity: normal | Resolution:
Keywords: |
--------------------+--------------------
Comment (by xcir):
I add vtc file.
Check varnish version is
{{{
varnishd (varnish-4.0.2 revision bfe7cd1)
and
varnishd (varnish-trunk revision a6ad0ea)
}}}
---
healthy.vtc is all backend is healthy.
Count of this direction is
{{{
s1=12
s2=16
s3=12
}}}
---
sick1.vtc is s1 is sick.
Count of this direction is
{{{
s2=28 (+12)
s3=12
}}}
All s1 to failover to the s2.
---
sick3.vtc is s3 is sick.
Count of this direction is
{{{
s1=12
s2=28 (+12)
}}}
All s3 to failover to the s2.
---
sick1_patch.vtc is s1 is sick.(for patched)
Count of this direction is
{{{
s2=25 (+9)
s3=15 (+3)
}}}
---
sick3_patch.vtc is s3 is sick.(for patched)
Count of this direction is
{{{
s1=17 (+5)
s2=23 (+7)
}}}
It's seem to be imbalanced.
https://github.com/varnish/Varnish-
Cache/blob/418cea5d6c32f14aaa16a7d0b58b8e8a6e287bb9/lib/libvmod_directors/vdir.c#L203
This code was subtraction total weight.
But, not regenerate w value.
If backend number is 3. select backend is following by w value.
{{{
s1 0.0~0.3
s2 0.3~0.6
s3 0.7~1.0
}}}
And, If sick a s1 backend. select backend is following by w value.
{{{
s2 0.0~0.5
s3 0.5~1.0
}}}
If value over 0.3 and s1 sick in vdir_pick_be. select to s2 or s3 without
check healthy.
But, if value less 0.3. select s2 with check healthy.
s1(healthy) and s2(sick) range is duplicated.
This is the imbalance reason.
You might want to regenerate the w value.
--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1658#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list