nigoroll / libvmod-dynamic

The Varnish dns/named director continued
BSD 2-Clause "Simplified" License
95 stars 34 forks source link

Add least connections and weighted least connections balancing algorithms #71

Closed karlvr closed 1 year ago

karlvr commented 3 years ago

There is some code to tidy up in here (a x 1.25 particularly), but I am hoping to gauge your interest in merging something like this! I made these changes several years ago, and we've been running with these changes for all of that time. Although I did just port them to 6.6.

Let me know and I'll work on making it beautiful with you!

nigoroll commented 3 years ago

So far, I only had a quick look: In general, I am open to the ideas. First comments:

On a practical side, this smells like a bit of work and I would need to check with current sponsors if they are interested in supporting integration work. This roadblock could of course be lifted by new sponsors ;)

nigoroll commented 1 year ago

No sponsor turned up in 1.5 years

karlvr commented 1 year ago

@nigoroll We've continued to find good results with the least connections and weighted least. Especially with our volume of traffic and pauses in backend applications, we often find that round robin ends up piling on connections to a server that is slower or momentarily paused. The heuristic nature (rather than guarantee) of the least connections metric works fine, as it is just a heuristic to improve the performance.

I have eliminated the slow start mechanism. We didn't require it and the implementation was a little odd.

I haven't used the SRV records stuff before but I can no doubt work out how to integrate least connections into it and work out if there's a nice way to use a similar implementation.

How are you feeling about this generally. Is it worth me putting in a bit more effort in SRV so we could merge it? Or do you think it is dependent on changes in varnish-cache and I should just keep on porting my changes forward each new varnish-cache version! :-)