Skip to content

Commit

Permalink
feat(docker): set nodejs max old space size based # of ans-104 workers
Browse files Browse the repository at this point in the history
Sets --max-old-space-size nodejs param to 8192 (8GB) if workers > 1 and
2048 (2GB) if workers <= 1. This provides a reasonable default for users
who either don't want to index ANS-104 bundles or use the default settings
to index ANS-104 bundles as well as power users who increase their worker
count.
  • Loading branch information
djwhitt committed Dec 20, 2023
1 parent 735c29b commit 6cfe5bf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ mkdir -p data/sqlite
/nodejs/bin/node dist/migrate.js up

if [ -z "$NODE_MAX_OLD_SPACE_SIZE" ]; then
NODE_MAX_OLD_SPACE_SIZE=2048
# 8GB for > 1 workers, 2GB for <= 1 worker
if [ "$ANS104_UNBUNDLE_WORKERS" -gt "1" ]; then
NODE_MAX_OLD_SPACE_SIZE=8192
else
NODE_MAX_OLD_SPACE_SIZE=2048
fi
fi

# Run the gateway service
Expand Down

0 comments on commit 6cfe5bf

Please sign in to comment.