by necubi · 3y ago · 0 comments
In a batch context this is most useful for sending computation to where the data is, but it's also the foundation for modern stream processing systems (like Flink or Arroyo) which are built over distributed dataflow DAGs.
This has worked well in practice, but I think does leave some performance on the table and likely incurrs higher resource utilization. Flink for example uses a system of "floating" buffers that can be moved between streams as needed to minimize the total number of buffers needed.
However it may be that Linux's network stack has gotten good enough at this point that it makes sense to just rely on it directly.
I wish there was more research out there on how these sorts of network stacks should be built on modern hardware and OSes.
(semi-relatedly, was checking out your CV; a bunch of great looking papers there that I'll definitely be checking out!)
In Flink, I believe the reason they need to implement their own backpressure system is that they multiplex TCP connections. That is, they have multiple logical streams flowing through a single TCP connection. If that's the case, you need to do some work to 1) detect which logical stream is the one that's blocking, and 2) don't block because other logical streams may be able to use the active TCP connection.
Thinking it through, I think what Flink's approach buys is not necessarily better performance, but better just a manageable number of connections. That is, imagine you have a process P1 with operators A, B and C. And then P2 has D, E, F. Now imagine that this is a shuffle, where A, B and C are fully connected to D, E and F. In my old system, you would have 9 TCP connections. In Flink, you will have 1.
[1] https://github.com/ArroyoSystems/arroyo/blob/master/arroyo-w... [2] https://github.com/IBM/sliding-window-aggregators/tree/maste...
But in practice the performance advantages of allowing operators to do work as they have capacity (rather than being potentially starved by the capacity of their downstreams) outweighs this.
[0] https://flink.apache.org/2019/06/05/a-deep-dive-into-flinks-...