-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve congestion control #1627
Conversation
// The whole pipeline is enabled or disabled | ||
disabled: AtomicBool, | ||
// Bitflags to indicate the given priority queue is congested | ||
congested: AtomicU8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussional: in order to reduce contention around this atomic, I'd recommend switching to a set of separate AtomicBool
and make 64-byte padding (maybe indirect by putting them into StageIn
etc). The cost of operation for multi-(thread,core,priority) setup should be smaller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that but increasing the number of atomics also increases the amount of data to be kept in cache. Having one atomic per priority will significantly put more burden on moving data across different cache level I assume, thus reducing performance in any case. I don't have an experimental comparison but I'm not expecting a lot of contention in general.
The bench is using CC::Block, so I suppose we are having smth with data structure sizes, not with atomics... |
Interesting, on my laptop I've actually gained ~500K msg/s with 8 bytes payload with this PR... |
I will retest it! |
I have to say that the gain in performance I observe on my laptop is not justified either... Nothing on this PR should provide better performance on the nominal case. |
So, after reboot I've got results equal to the reference! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A really great thing for slow subscriber problem!
This PR introduces:
wait_before_drop
timeoutEarly dropping drastically helps in the case of having a slow subscriber in the system, e.g.:
That means a slow subscriber will have a minima impact on the system when
CongestionControl::Drop
is used.No change in behaviour is introduced in the case of using
CongestionControl::Block
.Validation steps
Set
CongestionControl::Block
in the z_pub_thr example.Modify the subscriber callback to block for some time in the z_sub example.
Main
Run the router:
Run throughput publisher:
Run slow subscriber:
Run throughput subscriber:
This PR
Run the router:
Run throughput publisher:
Run slow subscriber:
Run throughput subscriber: