[dnsdist] leastOutstanding - With priority
theodore at ciscodude.net
Sun Jan 8 07:27:55 UTC 2017
> On Jan 5, 2017, at 11:52 PM, Chris <lists at shthead.net> wrote:
> On 5/01/2017 10:15 PM, Remi Gacogne wrote:
>> You should be able to write a custom load-balancing policy in Lua quite
>> easily, the Lua policy function gets the list of servers in the selected
>> pool, and from the server object you can get its status (up or down),
>> order and weight. You can easily select all the available servers of
>> order 1 and pick one at random. If there is no such server available,
>> pick one of order 10.
> It looks like this is what I have to do.
> I am new to Lua, so there is more than likely a more efficient way to do this than I have done but it looks like I have it working now.
> If anyone else is interested in doing it I put the code on GitHub, feel free to use it as a template/example or hack away at it: https://github.com/sysadminblog/dnsdist-configs/blob/master/orderedLeastOutstanding.lua
> If anyone has a look and has any comments on what could be done better I am happy to learn :)
I forked your repo and created an orderedwrandom (tiered failback, keeping all caches hot at the current layer)
Your code was very easy to understand and modify!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dnsdist