Viktor Dukhovni: > On Wed, Jun 24, 2020 at 04:43:55PM -0400, Wietse Venema wrote: > > > For a given transport and destination, if all three classes have > > work then round-robin interleaving gives each class gets 1/3 of the > > delivery slots, 1/2 if there are only two classes with work, all > > slots if there is only one class witth work, and zero if there is > > no work. > > > > If implemented in oqmgr, it's brain-dead round-robin with FIFO. > > What could possibly go wrong? :-) Well it does not interleave > > deliveries within the same class. But, with single-recipient messages, > > that wasn't happening anyway, so we are not making things worse. > > My instinct is that just "oqmgr" + coarse classes is not quite enough. > There can be multiple large messages in one of the larger classes that > can take a while to drain to a popular destination. There should > still be some sort of preemption after a particular message group > has consumed enough resources.
Possible solutions: a) Within a class and destination, select round-robin by sender key, and then deliver that sender's requests in FIFO order. That would maximize fairness, while making the data more complex. b) Within a class and destination, forget about FIFO order and use random selection. That would not increase data struture complexity, but the increased tail latency would weaken fairness. c) Within a class and destination, shuffle the FIFO in a more careful manner, or select randomly only from the first N entries in a FIFO. Ideally, deliveries from different senders always interleave, and no sender can hog resources. Wietse