diff options
Diffstat (limited to 'scripts/rabbitmq-server')
| -rwxr-xr-x | scripts/rabbitmq-server | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/rabbitmq-server b/scripts/rabbitmq-server index 27948ea6b7..f8b868c039 100755 --- a/scripts/rabbitmq-server +++ b/scripts/rabbitmq-server @@ -120,6 +120,25 @@ if [ ! -f "${RABBITMQ_SCHEMA_DIR}/rabbit.schema" ]; then cp "${RABBITMQ_HOME}/priv/schema/rabbit.schema" "${RABBITMQ_SCHEMA_DIR}" fi +# The default allocation strategy RabbitMQ is using was introduced +# in Erlang/OTP 20.2.3. Earlier Erlang versions fail to start with +# this configuration. We therefore need to ensure that erl accepts +# these values before we can use them. +# +# The defaults are meant to reduce RabbitMQ's memory usage and help +# it reclaim memory at the cost of a slight decrease in performance +# (due to an increase in memory operations). These defaults can be +# overriden using the RABBITMQ_SERVER_ERL_ARGS variable. +RABBITMQ_DEFAULT_ALLOC_ARGS="+MBas ageffcbf +MHas ageffcbf +MBlmbcs 512 +MHlmbcs 512 +MMmcs 30" + +${ERL_DIR}erl ${RABBITMQ_DEFAULT_ALLOC_ARGS} \ + -boot "${CLEAN_BOOT_FILE}" \ + -noinput -eval 'halt(0)' 2>/dev/null + +if [ $? != 0 ] ; then + RABBITMQ_DEFAULT_ALLOC_ARGS= +fi + set -e RABBITMQ_CONFIG_FILE_NOEX="${RABBITMQ_CONFIG_FILE%.*}" @@ -213,6 +232,7 @@ start_rabbitmq_server() { ${RABBITMQ_CONFIG_ARG} \ +W w \ +A ${RABBITMQ_IO_THREAD_POOL_SIZE} \ + ${RABBITMQ_DEFAULT_ALLOC_ARGS} \ ${RABBITMQ_SERVER_ERL_ARGS} \ +K true \ -kernel inet_default_connect_options "[{nodelay,true}]" \ |
