Skip to content

feat: remove gc restriction for large mem;#3140

Merged
zzzckck merged 1 commit intobnb-chain:developfrom
galaio:remove-gc-limit
Jun 3, 2025
Merged

feat: remove gc restriction for large mem;#3140
zzzckck merged 1 commit intobnb-chain:developfrom
galaio:remove-gc-limit

Conversation

@galaio
Copy link
Contributor

@galaio galaio commented Jun 3, 2025

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, then gogc=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.

image

Node1, 10.213.32.160:
--cache 18000
Use optimized gogc version

Node1, 10.213.32.78:
--cache18000
v1.5.12

Changes

Notable changes:

  • feat: remove gc restriction for large mem;
  • ...

@galaio galaio requested review from buddh0 and zzzckck June 3, 2025 07:42
@zzzckck zzzckck merged commit a40497f into bnb-chain:develop Jun 3, 2025
7 checks passed
sysvm pushed a commit to sysvm/bsc that referenced this pull request Jun 16, 2025
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