feat: Add ulimit cap to prevent memory bloat in some misconfigured versions of Docker/containerd Hosts (e.g. on Debian 13) #5025
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.
On certain systems (e.g., Debian 13 with modern container runtimes), a very high default
nofilesulimit can cause the Erlang VM (beam.smp) to pre-allocate excessive amounts of memory, leading to container crashes.This change introduces a safeguard directly into the entrypoint script:
ulimit -nto a configurable maximum, defined by theULIMIT_MAX_NOFILEenvironment variable (defaults to 65536).ULIMIT_MAX_NOFILE=0.To satisfy ShellCheck (SC3045), the script's shebang is set to
#!/usr/bin/env dash, asulimit -nis a common but not strictly POSIX-compliant extension.For consistency with the
entrypoint.shscript's shebang (#!/usr/bin/env dash), this change updates the Dockerfile's ENTRYPOINT to call/bin/dashdirectly instead of/bin/sh.fixes #4940 and related to #3045.
successor of #4999. Thanks @dyxyl for your work on this.
Architecture decision
Rather than changing the documentation to set up the host correctly, this change means that users do not need to update their Docker Compose files. This results in fewer tickets about memory bloat, because users did not follow the latest documentation.