-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Send notifications in batches #5054
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
base: 11-28-several_metrics_changes
Are you sure you want to change the base?
Send notifications in batches #5054
Conversation
0119199 to
4a1d5ca
Compare
b1e7db4 to
106ed89
Compare
4a1d5ca to
c627bad
Compare
106ed89 to
5c1a62d
Compare
c627bad to
6c566c1
Compare
3a99dd2 to
8473288
Compare
6c566c1 to
469db12
Compare
469db12 to
58b94ab
Compare
8473288 to
742eb97
Compare
58b94ab to
8b41b5a
Compare
742eb97 to
6e01efd
Compare
8b41b5a to
bb38573
Compare
3dbb400 to
514f4b7
Compare
bb38573 to
26e0c2b
Compare
|
I can also try to keep |
26e0c2b to
c0eced0
Compare
b618da9 to
dc6d19a
Compare
c0eced0 to
73b4c94
Compare
dc6d19a to
3876afe
Compare
|
For the future (but also this PR): When you're making PRs that claim to improve performance I'd like to see some comparison/data for before vs after. It can be screenshots from Grafana, copy-paste from the terminal etc. |
afck
left a comment
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.
So this batches notifications when sending them server→proxy or server→exporter, but not proxy→client, right? (Would be helpful to clarify that in the description.)
I'd also like to see more data about how this improves performance. Approving assuming the improvement is significant.
| exporter_clients: Vec<NotifierServiceClient<Channel>>, | ||
| pending_notifications: Vec<Notification>, | ||
| futures: FuturesUnordered<BoxFuture<'static, ()>>, | ||
| tasks_in_flight: usize, |
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.
Isn't this redundant? Isn't it always equal to self.futures.len()?
| } | ||
| Err(status) => { | ||
| // We assume errors when parsing are not critical and just log them. | ||
| tracing::warn!(error=?status, "received bad notification"); |
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.
(Not in this PR, but: Why not call the variable error? Or log it as ?status?)

Motivation
Sending notifications one at a time creates high RPC overhead. Batching notifications reduces overhead and improves
throughput.
Proposal
NotifyBatchRPC method for sending multiple notifications at onceBatchForwarderfor collecting and sending batched notificationsTest Plan
Release Plan