[dnsdist] leastOutstanding - With priority

Theodore Baschak 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:
> 
> Hi,
> 
> 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)
https://github.com/tbaschak/dnsdist-configs/blob/master/orderedwrandom.lua <https://github.com/tbaschak/dnsdist-configs/blob/master/orderedwrandom.lua>

Your code was very easy to understand and modify!

Thanks,
Theo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/dnsdist/attachments/20170108/f7ef81d9/attachment.html>


More information about the dnsdist mailing list