From 28d6b19bfb8d06d7f69f76fa9e05bbf94edc8dab Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Tue, 30 Aug 2022 15:31:43 -0700 Subject: [PATCH] Set ERL_MAX_ETS_TABLES and ERL_MAX_PORTS in the same manner as on Windows See discussion here: https://github.com/docker-library/rabbitmq/issues/545 --- deps/rabbit/scripts/rabbitmq-env | 17 ++++++++++++++--- deps/rabbit/scripts/rabbitmq-server | 5 ----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/deps/rabbit/scripts/rabbitmq-env b/deps/rabbit/scripts/rabbitmq-env index 4dde6f39485f..1c7ed764b9bc 100755 --- a/deps/rabbit/scripts/rabbitmq-env +++ b/deps/rabbit/scripts/rabbitmq-env @@ -94,10 +94,21 @@ ESCRIPT_DIR="${RABBITMQ_HOME}/escript" saved_RABBITMQ_PID_FILE="$RABBITMQ_PID_FILE" ## Get configuration variables from the configure environment file -[ "x" = "x$RABBITMQ_CONF_ENV_FILE" ] && RABBITMQ_CONF_ENV_FILE=${CONF_ENV_FILE} -if [ -f "${RABBITMQ_CONF_ENV_FILE}" ]; then +[ "x" = "x$RABBITMQ_CONF_ENV_FILE" ] && RABBITMQ_CONF_ENV_FILE="$CONF_ENV_FILE" +if [ -f "$RABBITMQ_CONF_ENV_FILE" ]; then CONF_ENV_FILE_PHASE=rabbitmq-env - . ${RABBITMQ_CONF_ENV_FILE} || true + . "$RABBITMQ_CONF_ENV_FILE" || true +fi + +# Bump ETS table limit to 50000 +if [ -z "$ERL_MAX_ETS_TABLES" ]; then + export ERL_MAX_ETS_TABLES=50000 +fi + +# Default is defined here: +# https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_port.h +if [ -z "$ERL_MAX_PORTS" ]; then + export ERL_MAX_PORTS=65536 fi [ -n "$ERL_EPMD_PORT" ] && export ERL_EPMD_PORT diff --git a/deps/rabbit/scripts/rabbitmq-server b/deps/rabbit/scripts/rabbitmq-server index c9612d89469c..7ac71d71bfd8 100755 --- a/deps/rabbit/scripts/rabbitmq-server +++ b/deps/rabbit/scripts/rabbitmq-server @@ -18,11 +18,6 @@ SCRIPTS_DIR=$(dirname "$0") RABBITMQ_DEFAULT_ALLOC_ARGS="+MBas ageffcbf +MHas ageffcbf +MBlmbcs 512 +MHlmbcs 512 +MMmcs 30" -# Bump ETS table limit to 50000 -if [ "x" = "x$ERL_MAX_ETS_TABLES" ]; then - ERL_MAX_ETS_TABLES=50000 -fi - check_start_params() { check_not_empty RABBITMQ_BOOT_MODULE check_not_empty SASL_BOOT_FILE