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 https://gist.github.com/rushilgupta/228dfdf379121cb9426d5e90d34c5b96 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
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 (https://cs.colby.edu/courses/S18/cs231-labs/labs/lab05/Mitzenmacher-2Choices-TPDS2001.pdf), and there is a great (also old at this point) paperswelove talk about the paper somewhere
Well, I'll have to label it as a fun exercise then
unless you can come up with a use case for which I bothered to implement it
it is super fun 🙂
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
I think https://www.youtube.com/watch?v=rTTVSUw1wio is the talk I am remembering
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