-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Index packets by priority to evict packet_batch when buffer reaches max limit #24069
Comments
#23841 implemented approach#2, I am bench testing it with differently scenarios, will report back the results. |
@carllin has a neat suggestion about approach#1 at #23841 (comment), essentially to update index (a min-max heap) for every received packets. |
the bench tests here test the performance of Incorporated Carl's bench scenario, where packets have uniformly distributed priority in each batch. It is the worst possible scenario for dropping batch by priority, cause algo has to iterated through |
here is a poc for approach 1: eagerly maintain an active per-packet priority index (as MinMaxHeap). Few design notes:
|
After applying the PoC to
This indicates that MinMaxHeap based index over |
Problem
When buffer in banking_stage reaches its max limit, instead of
pop
ing the oldestpacket_batch
which may contain high prioritypacket
s, it should drop low prioritypacket
s first.For context, by default the buffer has max limit of
2000
packet_batches, each packet_batch could have 128 packets. A buffer therefore can have up to256_000
packets. In order to drop low priority packets first, they need to be somehow indexed.The issue is when (and how) to index them.
Proposed Solution
There are two approaches, and maybe some combinations in between:
The choice would depend on how frequently buffer reaches its limit. Metrics indicates spikes in dropped packets during IDO/NFT, example
Purple is received packets count, Blue is dropped number of packets.
There are maybe other approaches, welcome inputs.
The text was updated successfully, but these errors were encountered: