Skip to content
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

v1.18: sleep instead of drop when stream rate exceeded limit; (backport of #939) #990

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Apr 23, 2024

Problem

Currently we are dropping the stream right away when the stream rate limit is being exceeded. The problem is the client can retry right away. In addition, the stream might have been received and can be used, dropping it waste resources.

Summary of Changes

Change to sleep instead of drop. Thanks to @alessandrod -- we sleep based on the estimated time to elapse to appease the rate limit and consider the RTT for the connection.

Fixes #


This is an automatic backport of pull request #939 done by [Mergify](https://mergify.com).

* sleep instead of drop when stream rate exceeded limit;

Consider connection count of staked nodes when calculating allowed PPS

remove rtt from throttle_duration calculation

removed connection count in StreamerCounter -- we do not need it at this point

* remove connection count related changes -- they are unrelated to this PR

* revert unintended changes

(cherry picked from commit 137a982)
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 45.00000% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 81.5%. Comparing base (5485ec1) to head (6ab6980).

Additional details and impacted files
@@            Coverage Diff            @@
##            v1.18     #990     +/-   ##
=========================================
- Coverage    81.5%    81.5%   -0.1%     
=========================================
  Files         827      827             
  Lines      224853   224860      +7     
=========================================
+ Hits       183467   183471      +4     
- Misses      41386    41389      +3     

@lijunwangs lijunwangs merged commit 9a085b2 into v1.18 Apr 23, 2024
35 checks passed
@lijunwangs lijunwangs deleted the mergify/bp/v1.18/pr-939 branch April 23, 2024 17:59
anwayde pushed a commit to firedancer-io/agave that referenced this pull request Jul 23, 2024
…rt of anza-xyz#939) (anza-xyz#990)

sleep instead of drop when stream rate exceeded limit; (anza-xyz#939)

* sleep instead of drop when stream rate exceeded limit;

Consider connection count of staked nodes when calculating allowed PPS

remove rtt from throttle_duration calculation

removed connection count in StreamerCounter -- we do not need it at this point

* remove connection count related changes -- they are unrelated to this PR

* revert unintended changes

(cherry picked from commit 137a982)

Co-authored-by: Lijun Wang <83639177+lijunwangs@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants