Skip to content

Commit

Permalink
Configurable Lodestar heap, Teku back down to 4g
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne committed Sep 18, 2023
1 parent 18d6950 commit e4fce31
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
8 changes: 5 additions & 3 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@ CL_EXTRAS=
# Additional parameters for the validator client.
VC_EXTRAS=

# Heap for Besu and Teku, both written in Java. Sets JAVA_OPTS to this
# value, for example TEKU_HEAP=-Xmx12g to set it to 12g. If left empty, the
# defaults in besu.yml and teku.yml are used.
# Heap for Besu and Teku, both written in Java. Sets JAVA_OPTS to this value, for example TEKU_HEAP=-Xmx12g to set it
# to 12g. If left empty, the defaults in besu.yml and teku.yml are used.
BESU_HEAP=
TEKU_HEAP=
# Heap for Lodestar. Sets NODE_OPTIONS to this value, for example --max-old-space-size=8192.
# If left empty, the default in lodestar.yml will be used.
LODESTAR_HEAP=

# Set this to true to sync an archive node instead of pruned for both CL
# and EL. Caution that this may a) require a fresh sync and b) will
Expand Down
2 changes: 1 addition & 1 deletion ethd
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ envmigrate() {
CL_NODE BEACON_STATS_API BEACON_STATS_MACHINE EL_P2P_PORT CL_P2P_PORT WEB3SIGNER PRYSM_PORT DOPPELGANGER \
PRYSM_UDP_PORT GRAFANA_PORT SIREN_PORT PROMETHEUS_PORT KEY_API_PORT TRAEFIK_WEB_PORT TRAEFIK_WEB_HTTP_PORT \
CL_REST_PORT EL_RPC_PORT EL_WS_PORT EE_PORT ERIGON_TORRENT_PORT LOG_LEVEL JWT_SECRET EL_EXTRAS CL_EXTRAS \
VC_EXTRAS ARCHIVE_NODE SSV_P2P_PORT SSV_P2P_PORT_UDP ERIGON_P2P_PORT_2 ERIGON_P2P_PORT_3 )
VC_EXTRAS ARCHIVE_NODE SSV_P2P_PORT SSV_P2P_PORT_UDP ERIGON_P2P_PORT_2 ERIGON_P2P_PORT_3 LODESTAR_HEAP )
TARGET_VARS=( NIM_SRC_BUILD_TARGET NIM_SRC_REPO NIM_DOCKER_TAG NIM_DOCKER_VC_TAG NIM_DOCKER_REPO \
NIM_DOCKER_VC_REPO NIM_DOCKERFILE TEKU_SRC_BUILD_TARGET TEKU_SRC_REPO TEKU_DOCKER_TAG TEKU_DOCKER_REPO \
TEKU_DOCKERFILE LH_SRC_BUILD_TARGET LH_SRC_REPO LH_DOCKER_TAG LH_DOCKER_REPO LH_DOCKERFILE \
Expand Down
2 changes: 1 addition & 1 deletion lodestar-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ services:
- CL_EXTRAS=${CL_EXTRAS:-}
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
- NETWORK=${NETWORK}
- NODE_OPTIONS=${LODESTAR_HEAP:---max-old-space-size=4096}
ports:
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
<<: *logging
entrypoint:
- docker-entrypoint.sh
- node
- --max-old-space-size=16384
- /usr/app/node_modules/.bin/lodestar
- beacon
- --dataDir
Expand Down
4 changes: 2 additions & 2 deletions lodestar-vc-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ services:
entrypoint:
- docker-entrypoint-vc.sh
- node
- --max-old-space-size=4096
- --max-old-space-size=2048
- /usr/app/node_modules/.bin/lodestar
- validator
- --dataDir
Expand Down Expand Up @@ -80,7 +80,7 @@ services:
- /etc/localtime:/etc/localtime:ro
entrypoint:
- node
- --max-old-space-size=4096
- --max-old-space-size=2048
- /usr/app/node_modules/.bin/lodestar
- validator
- voluntary-exit
Expand Down
6 changes: 3 additions & 3 deletions lodestar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ services:
- CL_EXTRAS=${CL_EXTRAS:-}
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
- NETWORK=${NETWORK}
- NODE_OPTIONS=${LODESTAR_HEAP:---max-old-space-size=4096}
ports:
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
<<: *logging
entrypoint:
- docker-entrypoint.sh
- node
- --max-old-space-size=16384
- /usr/app/node_modules/.bin/lodestar
- beacon
- --dataDir
Expand Down Expand Up @@ -105,7 +105,7 @@ services:
entrypoint:
- docker-entrypoint-vc.sh
- node
- --max-old-space-size=4096
- --max-old-space-size=2048
- /usr/app/node_modules/.bin/lodestar
- validator
- --dataDir
Expand Down Expand Up @@ -141,7 +141,7 @@ services:
- /etc/localtime:/etc/localtime:ro
entrypoint:
- node
- --max-old-space-size=4096
- --max-old-space-size=2048
- /usr/app/node_modules/.bin/lodestar
- validator
- voluntary-exit
Expand Down
8 changes: 5 additions & 3 deletions lodestar/Dockerfile.binary
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ RUN adduser \
--uid "${UID}" \
"${USER}"

RUN mkdir -p /var/lib/lodestar/consensus/ee-secret && chown -R ${USER}:${USER} /var/lib/lodestar/consensus && chmod -R 700 /var/lib/lodestar/consensus && chmod 777 /var/lib/lodestar/consensus/ee-secret
RUN mkdir -p /var/lib/lodestar/consensus/ee-secret && chown -R ${USER}:${USER} /var/lib/lodestar/consensus \
&& chmod -R 700 /var/lib/lodestar/consensus && chmod 777 /var/lib/lodestar/consensus/ee-secret

# Cannot assume buildkit, hence no chmod
COPY --chown=${USER}:${USER} ./docker-entrypoint.sh /usr/local/bin/
Expand All @@ -43,11 +44,12 @@ RUN adduser \
"${USER}"

# Create data mount point with permissions
RUN mkdir -p /var/lib/lodestar/validators && chown -R ${USER}:${USER} /var/lib/lodestar/validators && chmod 700 /var/lib/lodestar/validators
RUN mkdir -p /var/lib/lodestar/validators && chown -R ${USER}:${USER} /var/lib/lodestar/validators \
&& chmod 700 /var/lib/lodestar/validators

# Cannot assume buildkit, hence no chmod
COPY --chown=${USER}:${USER} ./docker-entrypoint-vc.sh /usr/local/bin/
# Belt and suspenders
RUN chmod -R 755 /usr/local/bin/*

ENTRYPOINT ["node", "--max-old-space-size=16384", "/usr/app/node_modules/.bin/lodestar"]
ENTRYPOINT ["node", "/usr/app/node_modules/.bin/lodestar"]
2 changes: 1 addition & 1 deletion teku-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/teku/ee-secret
environment:
- JAVA_OPTS=${TEKU_HEAP:--Xmx7g}
- JAVA_OPTS=${TEKU_HEAP:--Xmx4g}
- RAPID_SYNC_URL=${RAPID_SYNC_URL}
- JWT_SECRET=${JWT_SECRET}
- MEV_BOOST=${MEV_BOOST}
Expand Down
2 changes: 1 addition & 1 deletion teku.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/teku/ee-secret
environment:
- JAVA_OPTS=${TEKU_HEAP:--Xmx7g}
- JAVA_OPTS=${TEKU_HEAP:--Xmx4g}
- RAPID_SYNC_URL=${RAPID_SYNC_URL}
- JWT_SECRET=${JWT_SECRET}
- MEV_BOOST=${MEV_BOOST}
Expand Down

0 comments on commit e4fce31

Please sign in to comment.