Skip to content

Commit d004059

Browse files
mkuratczykmergify[bot]
authored andcommitted
Add RABBITMQ_MAX_OPEN_FILES variable to the startup script
In some environments it may be tricky to run a command before RabbitMQ is started. Kubernetes For example, upgrading to Containerd 2.0 accidentally lowered the value of available descriptors in GKE (https://cloud.google.com/kubernetes-engine/docs/troubleshooting/known-issues#containerd-ulimit-reduced). While this particular issue is resolved in newer GKE versions, it was a good example of why a variable like this would be helpful. Kubernetes-level solutions (on the node or with a daemonset) would require a different level of access for users. (cherry picked from commit ad3fccf)
1 parent 31733d8 commit d004059

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

deps/rabbit/scripts/rabbitmq-server

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ start_rabbitmq_server() {
3939

4040
_rmq_env_set_erl_libs
4141

42+
if [ -n "$RABBITMQ_MAX_OPEN_FILES" ]; then
43+
if ! ulimit -n ${RABBITMQ_MAX_OPEN_FILES}; then
44+
echo "Error: Failed to set maximum number of open files to ${RABBITMQ_MAX_OPEN_FILES}" >&2
45+
exit 1
46+
fi
47+
fi
48+
4249
RABBITMQ_START_RABBIT=
4350
[ "x" = "x$RABBITMQ_ALLOW_INPUT" ] && RABBITMQ_START_RABBIT=" -noinput"
4451
if test -z "$RABBITMQ_NODE_ONLY"; then

0 commit comments

Comments
 (0)