feat: remove gc restriction for large mem;#3140
Merged
zzzckck merged 1 commit intobnb-chain:developfrom Jun 3, 2025
Merged
Conversation
buddh0
approved these changes
Jun 3, 2025
zzzckck
approved these changes
Jun 3, 2025
sysvm
pushed a commit
to sysvm/bsc
that referenced
this pull request
Jun 16, 2025
This was referenced Jun 16, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In the bsc code, the parameter settings for gogc are relatively strict, which will greatly waste memory space for the currently recommended configuration.
In the current code, if a 256GB machine is set to
--cache 64000, thengogc=20, which will trigger gogc very frequently and affect performance.In this PR, the parameter conditions of gogc are optimized. When the machine memory is large enough, the current threshold is 64GB, and gogc will use the default value.
In actual tests, on the i7i.8xlarge machine, removing the gogc restriction improves the performance of daily traffic in mainnet by ~10%.
At the same time, the performance jitter of the program is less when restarting.
In addition, based on this PR, users can still use GOGC=100 to continue optimizing gogc parameters.
Example
As shown in the figure below, after optimizing the gogc parameters, the insert time was reduced by ~10% over 5 days of mainnet natural traffic.
Node1, 10.213.32.160:
--cache 18000
Use optimized gogc version
Node1, 10.213.32.78:
--cache18000
v1.5.12
Changes
Notable changes: