|
|
5c27b6 |
From a5ceaa8601794b7a60726c7fed5bf29dde15c9b2 Mon Sep 17 00:00:00 2001
|
|
|
5c27b6 |
Message-Id: <a5ceaa8601794b7a60726c7fed5bf29dde15c9b2@dist-git>
|
|
|
5c27b6 |
From: "Daniel P. Berrange" <berrange@redhat.com>
|
|
|
5c27b6 |
Date: Thu, 13 Apr 2017 13:36:31 -0400
|
|
|
5c27b6 |
Subject: [PATCH] Increase default file handle limits for daemons
|
|
|
5c27b6 |
|
|
|
5c27b6 |
Linux still defaults to a 1024 open file handle limit. This causes
|
|
|
5c27b6 |
scalability problems for libvirtd / virtlockd / virtlogd on large
|
|
|
5c27b6 |
hosts which might want > 1024 guest to be running. In fact if each
|
|
|
5c27b6 |
guest needs > 1 FD, we can't even get to 500 guests. This is not
|
|
|
5c27b6 |
good enough when we see machines with 100's of physical cores and
|
|
|
5c27b6 |
TBs of RAM.
|
|
|
5c27b6 |
|
|
|
5c27b6 |
In comparison to other memory requirements of libvirtd & related
|
|
|
5c27b6 |
daemons, the resource usage associated with open file handles
|
|
|
5c27b6 |
is essentially line noise. It is thus reasonable to increase the
|
|
|
5c27b6 |
limits unconditionally for all installs.
|
|
|
5c27b6 |
|
|
|
5c27b6 |
Resolves: https://bugzilla.redhat.com/1442043 (RHEL7.3.z)
|
|
|
5c27b6 |
Resolves: https://bugzilla.redhat.com/1429551 (RHEL7.4)
|
|
|
5c27b6 |
|
|
|
5c27b6 |
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
|
|
|
5c27b6 |
(cherry picked from commit 27cd76350021d36b9bd8b187ce5c8919659e3806)
|
|
|
5c27b6 |
---
|
|
|
5c27b6 |
daemon/libvirtd.service.in | 7 +++++--
|
|
|
5c27b6 |
src/locking/virtlockd.service.in | 4 ++++
|
|
|
5c27b6 |
src/logging/virtlogd.service.in | 5 +++++
|
|
|
5c27b6 |
3 files changed, 14 insertions(+), 2 deletions(-)
|
|
|
5c27b6 |
|
|
|
5c27b6 |
diff --git a/daemon/libvirtd.service.in b/daemon/libvirtd.service.in
|
|
|
5c27b6 |
index bbf27dae9..5f5d35edb 100644
|
|
|
5c27b6 |
--- a/daemon/libvirtd.service.in
|
|
|
5c27b6 |
+++ b/daemon/libvirtd.service.in
|
|
|
5c27b6 |
@@ -23,8 +23,11 @@ ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
|
|
|
5c27b6 |
ExecReload=/bin/kill -HUP $MAINPID
|
|
|
5c27b6 |
KillMode=process
|
|
|
5c27b6 |
Restart=on-failure
|
|
|
5c27b6 |
-# Override the maximum number of opened files
|
|
|
5c27b6 |
-#LimitNOFILE=2048
|
|
|
5c27b6 |
+# At least 1 FD per guest, often 2 (eg qemu monitor + qemu agent).
|
|
|
5c27b6 |
+# eg if we want to support 4096 guests, we'll typically need 8192 FDs
|
|
|
5c27b6 |
+# If changing this, also consider virtlogd.service & virtlockd.service
|
|
|
5c27b6 |
+# limits which are also related to number of guests
|
|
|
5c27b6 |
+LimitNOFILE=8192
|
|
|
5c27b6 |
|
|
|
5c27b6 |
[Install]
|
|
|
5c27b6 |
WantedBy=multi-user.target
|
|
|
5c27b6 |
diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.service.in
|
|
|
5c27b6 |
index 57089b046..4907e3290 100644
|
|
|
5c27b6 |
--- a/src/locking/virtlockd.service.in
|
|
|
5c27b6 |
+++ b/src/locking/virtlockd.service.in
|
|
|
5c27b6 |
@@ -12,6 +12,10 @@ ExecReload=/bin/kill -USR1 $MAINPID
|
|
|
5c27b6 |
# cause the machine to be fenced (rebooted), so make
|
|
|
5c27b6 |
# sure we discourage OOM killer
|
|
|
5c27b6 |
OOMScoreAdjust=-900
|
|
|
5c27b6 |
+# Needs to allow for max guests * average disks per guest
|
|
|
5c27b6 |
+# libvirtd.service written to expect 4096 guests, so if we
|
|
|
5c27b6 |
+# allow for 4 disks per guest, we get:
|
|
|
5c27b6 |
+LimitNOFILE=16384
|
|
|
5c27b6 |
|
|
|
5c27b6 |
[Install]
|
|
|
5c27b6 |
Also=virtlockd.socket
|
|
|
5c27b6 |
diff --git a/src/logging/virtlogd.service.in b/src/logging/virtlogd.service.in
|
|
|
5c27b6 |
index 09e074014..8b67317cb 100644
|
|
|
5c27b6 |
--- a/src/logging/virtlogd.service.in
|
|
|
5c27b6 |
+++ b/src/logging/virtlogd.service.in
|
|
|
5c27b6 |
@@ -13,6 +13,11 @@ ExecReload=/bin/kill -USR1 $MAINPID
|
|
|
5c27b6 |
# cause the machine to be fenced (rebooted), so make
|
|
|
5c27b6 |
# sure we discourage OOM killer
|
|
|
5c27b6 |
OOMScoreAdjust=-900
|
|
|
5c27b6 |
+# Need to have at least one file open per guest (eg QEMU
|
|
|
5c27b6 |
+# stdio log), but might be more (eg serial console logs)
|
|
|
5c27b6 |
+# libvirtd.service written to expect 4096 guests, so if we
|
|
|
5c27b6 |
+# guess at 2 log files per guest here (stdio + 1 serial):
|
|
|
5c27b6 |
+LimitNOFILE=8192
|
|
|
5c27b6 |
|
|
|
5c27b6 |
[Install]
|
|
|
5c27b6 |
Also=virtlogd.socket
|
|
|
5c27b6 |
--
|
|
|
5c27b6 |
2.12.2
|
|
|
5c27b6 |
|