News for hackers. Stuff that matters.
Re:Solving the Mystery of Link Imbalance: A Metastable Failu... by jessaustin on Wednesday November 26, 2014 @09:08AM (#8662312)
This keeps all the packets of a TCP stream on the same link, avoiding out-of-order delivery.

Not a network engineer, but I had thought that TCP handles ordering itself? Packets can travel completely different routes from origin to destination, so one can't expect them to arrive in order. Destination's TCP stack can deal with it.

Again, IANANE, but ISTM that those who first designed the network introduced an untested complication with their LIFO setup. Nearly anything would have worked, including not pooling at all. They just chose something weird for the hell of it. Later FB needed more performance out of the system, and this harmful complication was hidden from sight.

Re:Solving the Mystery of Link Imbalance: A Metastable Failu... by The_Fox on Wednesday November 26, 2014 @10:27AM (#8662704)
TCP reorders segments just fine but it treats disordering as a congestion signal and slows down. That's why link aggregation frequently uses the technique of pinning flows to a single link- to minimize disordering so as to avoid triggering TCP congestion control.

In Linux, you can change the sensitivity to disordering by writing to /proc/sys/net/ipv4/tcp_reordering.

Re:Solving the Mystery of Link Imbalance: A Metastable Failu... by ngbronson on Wednesday November 26, 2014 @12:20PM (#8663370)
When the pool was originally coded, MySQL had one thread per open connection. That made the auto-sizing MRU pool a pretty big win, because it kept the connection counts as low as possible while using the warmest database threads. MySQL has matured since then, so this optimization is no longer important.

Out-of-order delivery causes TCP to shrink the congestion windows, which cuts throughput. Connection pools help here (in addition to their reduction in setup and teardown work), because they let the windows widen and stay open. We disable tcp_slow_start_after_idle to take advantage of this.

Re:Solving the Mystery of Link Imbalance: A Metastable Failu... by darrin on Wednesday November 26, 2014 @09:42AM (#8662465)
Yes, TCP will reorder if necessary, but that will introduce some delay and overhead at the host. The missing sequence number (the out of order frame) will cause queuing as TCP waits for it to arrive or requests retransmit, so keeping streams in order in the network is more efficient.