core-async

Ben Sless 2020-11-30T18:18:22.269200Z

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)

2020-11-30T18:31:52.271100Z

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 Sless 2020-11-30T18:34:28.273500Z

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

2020-11-30T18:35:42.274600Z

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

2020-11-30T18:38:33.276700Z

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 Sless 2020-11-30T18:39:34.277200Z

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

Ben Sless 2020-11-30T18:42:41.277700Z

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

2020-11-30T18:45:13.277900Z

it is super fun 🙂

Ben Sless 2020-11-30T18:46:16.278300Z

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

2020-11-30T19:25:49.281Z

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.

2020-11-30T19:27:47.282100Z

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

2020-11-30T19:33:32.282500Z

I think https://www.youtube.com/watch?v=rTTVSUw1wio is the talk I am remembering

ghadi 2020-11-30T19:39:28.282900Z

that’s a good paper

ghadi 2020-11-30T19:39:45.283500Z

There’s also aperture load balancing from twitter

2020-11-30T19:41:30.284200Z

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