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

Consider increasing default value for --max-old-space-size #6137

Closed
nflaig opened this issue Nov 28, 2023 · 3 comments · Fixed by #6343
Closed

Consider increasing default value for --max-old-space-size #6137

nflaig opened this issue Nov 28, 2023 · 3 comments · Fixed by #6343
Labels
meta-discussion Indicates a topic that requires input from various developers. meta-feature-request Issues to track feature requests.
Milestone

Comments

@nflaig
Copy link
Member

nflaig commented Nov 28, 2023

Problem description

Current default value (4096) is not sufficient for Holesky and causes node to crash during sync or unhealthy network conditions. Mainnet state is growing and we should consider increasing the default value before we run into the same issue there.

Solution description

Increase --max-old-space-size default value from 4096 to 6144.

Additional context

--max-old-space-size is set in Dockerfile and Lodestar shell script

ENV NODE_OPTIONS=--max-old-space-size=4096

node --trace-deprecation --max-old-space-size=4096 ./packages/cli/bin/lodestar.js "$@"

@nflaig nflaig added the meta-feature-request Issues to track feature requests. label Nov 28, 2023
@twoeths
Copy link
Contributor

twoeths commented Nov 29, 2023

We will need to reevaluate this value after n-historical state work #5968

@dapplion
Copy link
Contributor

dapplion commented Dec 1, 2023

Can this value be set dynamically depending on the host's memory? Assume Lodestar is running on a host with 16GB or RAM, why limit ourselves to 4GB only?

@nflaig
Copy link
Member Author

nflaig commented Dec 1, 2023

I noticed that node itself already sets it dynamically based on some host stats / configuration, default is 4GB on my machine

node -e "console.log(require('v8').getHeapStatistics().heap_size_limit / 1024 ** 3)"
4.046875

Could set it based on free memory (or total memory)

--max-old-space-size=$(expr $(echo "$(free -m)" | awk '/^Mem:/ {print $2}') - 512)

But I am not sure if that's good either as it is not adjusted dynamically during runtime, so it would depend on the startup order of EL / CL and other services running on the host.

I think it's important that it can be easily configured by operators as you might have to increase it during long periods of non-finality, which is quite easy on docker based deployments as a lot of those provide a environment variable for it. On dappnode, we also use a higher value for holesky at the moment which is configured on the package itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta-discussion Indicates a topic that requires input from various developers. meta-feature-request Issues to track feature requests.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants