Fork me on GitHub
#core-async
<
2020-11-30
>
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 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)

hiredman18:11:52

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?

hiredman18:11:42

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

hiredman18:11:33

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

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

hiredman18:11:13

it is super fun đŸ™‚

Ben Sless18:11:16

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

hiredman19:11:49

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.

hiredman19:11:47

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

ghadi19:11:28

that’s a good paper

ghadi19:11:45

There’s also aperture load balancing from twitter

hiredman19:11:30

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