Fork me on GitHub
Ben Sless18:11:22

Hi all, do you think there's a point to implementing a load balancer like in Rob Pyke's Concurrency Is Not Parallelism talk? See golang example here TLDR: a group of identical consuming processes downstream, select the process with the smallest buffer (i.e. least amount of backpressure)


it depends what you mean by a point. I don't think a load balancer like that is particular useful in the real world in the domain in which go and core.async channels operate (in memory communication on a single machine), but they can be useful to model and think about the communication patterns in larger multi-machine systems

Ben Sless18:11:28

Why not? especially if you implement the in-process-server like in the example. You think it's impractical?


because in process on a single server your responses are all being generated by threads from the same threadpool, so you aren't really balancing anything at all


for modeling and understanding load balancing I think that gist could be improved a fair bit starting from this old paper (, and there is a great (also old at this point) paperswelove talk about the paper somewhere

Ben Sless18:11:34

Well, I'll have to label it as a fun exercise then

Ben Sless18:11:41

unless you can come up with a use case for which I bothered to implement it


it is super fun đŸ™‚

Ben Sless18:11:16

That it was. Implementing the async version was a bit confusing, though


the big take aways from the the 2 choices paper (and maybe the paperswelove talk, the two are muddled in my memory) is when the lb gets a request it pushes a "reservation" to N workers, and those workers process their queue of reservations by pulling the work identified by the reservation from the lb.


and that process with the reservations gets rid of the lb needing to keep track of which worker has the smallest queue


that’s a good paper


There’s also aperture load balancing from twitter


that is a new thing right? I saw it go by (appropriately on twitter) but haven't actually learned anything about it