[PATCH] Raise the file limit on the RabbitMQ cluster

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



RabbitMQ recommends[0] that the open file descriptor limit be set to a
minimum of 50K. It recommends that the maximum number of open
connections be multiplied by 2 and added to the total number of queues.
Finally, it suggests that 500K isn't an unreasonable setting. This sets
the default to 500K and makes the value configurable.

[0] https://www.rabbitmq.com/production-checklist.html

Signed-off-by: Jeremy Cline <jcline@xxxxxxxxxx>
---

I have permissions to commit this, but I'd like the sysadmins to review
it for (in)sanity.

 handlers/restart_services.yml            |  6 ++++++
 roles/rabbitmq_cluster/defaults/main.yml |  2 ++
 roles/rabbitmq_cluster/tasks/main.yml    | 18 ++++++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 roles/rabbitmq_cluster/defaults/main.yml

diff --git a/handlers/restart_services.yml b/handlers/restart_services.yml
index b21d8ec25..f791ce084 100644
--- a/handlers/restart_services.yml
+++ b/handlers/restart_services.yml
@@ -179,3 +179,9 @@
 
 - name: restart buildmaster
   service: name=buildmaster state=restarted
+
+- name: restart rabbitmq
+  systemd:
+    name: rabbitmq-server
+    state: restarted
+    systemd_reload: yes
diff --git a/roles/rabbitmq_cluster/defaults/main.yml b/roles/rabbitmq_cluster/defaults/main.yml
new file mode 100644
index 000000000..b58d65393
--- /dev/null
+++ b/roles/rabbitmq_cluster/defaults/main.yml
@@ -0,0 +1,2 @@
+# https://www.rabbitmq.com/production-checklist.html#resource-limits-file-handle-limit
+rabbitmq_cluster_file_limit: 500000
diff --git a/roles/rabbitmq_cluster/tasks/main.yml b/roles/rabbitmq_cluster/tasks/main.yml
index e3d8442ee..468cbc5ac 100644
--- a/roles/rabbitmq_cluster/tasks/main.yml
+++ b/roles/rabbitmq_cluster/tasks/main.yml
@@ -78,6 +78,24 @@
   - rabbitmq_cluster
   - config
 
+- name: Create RabbitMQ systemd override directory
+  file:
+    path: /etc/systemd/system/rabbitmq-server.service.d/
+    state: directory
+  tags:
+  - rabbitmq_cluster
+  - config
+
+- name: Override file limit on rabbitmq
+  copy:
+    content: "[Service]\nLimitNOFILE={{rabbitmq_cluster_file_limit}}\n"
+    dest: /etc/systemd/system/rabbitmq-server.service.d/override.conf
+  notify:
+    - restart rabbitmq
+  tags:
+  - rabbitmq_cluster
+  - config
+
 - name: start rabbitmq
   service: name=rabbitmq-server state=started enabled=yes
   tags:
-- 
2.17.1
_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux