-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Grow TxQ expected size quickly, shrink slowly (RIPD-1534): #2235
Conversation
src/ripple/app/misc/impl/TxQ.cpp
Outdated
return *iter; | ||
// 90% backoff to decrease | ||
// down to the actual max. | ||
return (txnsExpected_ * 9 + *iter) / 10; |
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'm reading this as 90% of txnsExpected_
plus 10% of "recent tx count max"...so the result will always be slightly less thantxnsExpected_
...correct?
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.
Correct. It allows the limit to come down gradually.
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 find the comment somewhat confusing. Can we brainstorm on some better wording?
Codecov Report
@@ Coverage Diff @@
## develop #2235 +/- ##
===========================================
+ Coverage 70.11% 70.11% +<.01%
===========================================
Files 689 689
Lines 50800 50810 +10
===========================================
+ Hits 35617 35626 +9
- Misses 15183 15184 +1
Continue to review full report at Codecov.
|
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.
Tentative approve from me; I've left a couple of small comments for your consideration. No changes needed really; it's at your discretion.
src/ripple/app/misc/impl/TxQ.cpp
Outdated
return *iter; | ||
// 90% backoff to decrease | ||
// down to the actual max. | ||
return (txnsExpected_ * 9 + *iter) / 10; |
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 find the comment somewhat confusing. Can we brainstorm on some better wording?
src/ripple/app/misc/impl/TxQ.cpp
Outdated
std::min(feeLevels.size(), *maximumTxnCount_) : | ||
feeLevels.size(); | ||
std::min(next, *maximumTxnCount_) : | ||
next; |
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.
This seems to be overly complex with no good reason. Consider:
txnsExpected_ = std::min(next, maximumTxnCount_.value_or(next));
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.
Much better.
src/ripple/app/misc/impl/TxQ.cpp
Outdated
} | ||
else if (feeLevels.size() > txnsExpected_ || | ||
feeLevels.size() > targetTxnCount_) | ||
{ | ||
recentTxnCounts_.emplace_back(feeLevels.size()); | ||
while (recentTxnCounts_.size() > setup.ledgersInQueue) |
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.
This bit of code suggests that a std::deque
may not be the right choice here. Have we considered boost::circular_buffer
?
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 had not, but that's a great idea.
* Stores recent history of "good" ledgers. Uses the maximum as the expected ledger size. When a large value drops off, use a 90% backoff to go down to to the new maximum. * If consensus is unhealthy, wipe the history in addition to the current clamping. * Include .md doc files in xcode and VS projects
Merged as c11e186 |
expected ledger size. When a large value drops off, use a 90%
backoff to go down to to the new maximum.
clamping.
Open question: Does this need to be behind an amendment? I don't think so because it only affects transaction queueing, not transaction processing, just as 0.70.2 didn't need an amendment.