-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Throttle greedy clients in orderer Broadcast API #4640
Conversation
27e2bcc
to
4b29392
Compare
b04dd53
to
25d96ea
Compare
1084f62
to
746f2dc
Compare
@yacovm |
I am not sure it fits our need. I need a dynamic rate limiter that limits on a per client basis and the budget is adjusted dynamically according to how many clients are connected. |
I used it for dynamic loading. Conditionally: the TPS of the system had to be X and had to be divided by all nodes. Nodes could crash and restart. And the throughput of the system should not change. |
There are already rate limiters implemented for Endorsering, Deliver, and Gateway services; wouldn't it be better to extend its usage for ordering service as well? See here: #647 . I understand the existing approach probably doesn't provide the desired granularity, though still, even putting rate limits with the grpc interceptor is a little bit cleaner approach rather than extending the broadcast handler. |
@yacovm, btw, do you also intend to add metrics to expose limiter budget utilization so operators can trace down setup and alerts to notify whenever the limit is exhausted per client or organization? Now, where the model is to use gateway service, meaning peers are collecting endorsements and submitting transactions, this might be crucial. |
I think you're talking about sending transactions and not receiving them, am I mistaken? |
They are not rate limiters, they are simply locks that limit too many gRPC streams being opened. This does not address the problem solved here. I think what I could have done alternatively was to make a proxy @C0rWin I made the above modification, now the broadcast service implementation remains as-is. |
The idea is cool but I have no intention of doing this, as this piece of work is not meant to be used in this manner. |
2feef45
to
93f3501
Compare
This commit implements a shared rate limiter for connections authenticated with mutual TLS. The throttling and rate limiting is applied at both the Authority Key Identifier and Subject Key Identifier level, which guarantees no single organization or client can bombard the orderer with endless transactions on the expense of others. The effective rate is divided across all clients and orgs for a time period specified by InactivityTimeout. By default this feature is turned off. Signed-off-by: Yacov Manevich <[email protected]>
This commit implements a shared rate limiter for connections authenticated with mutual TLS. The throttling and rate limiting is applied at both the Authority Key Identifier and Subject Key Identifier level, which guarantees no single organization or client can bombard the orderer with endless transactions on the expense of others.
The effective rate is divided across all clients and orgs for a time period specified by InactivityTimeout.
By default this feature is turned off.