[libvirt] [PATCH 0/2] Further Increase default file handle limits

In 27cd7635 new default limits were set: Author: Daniel P. Berrange <berrange@redhat.com> Date: Wed Mar 15 16:51:51 2017 +0000 Increase default file handle limits for daemons But I faced some constraints with these values and think it is time to reconsider the defaults to only have to be tweaked in really uncommon cases. Christian Ehrhardt (2): Increase default file handle limits for virtlogd Increase default file handle limits for virtlockd src/locking/virtlockd.service.in | 4 ++-- src/logging/virtlogd.service.in | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) -- 2.7.4

The initial assumption was ~2 files per guest, but some common setups like Openstack drive up to 4 files per guest. E.g. on Arm where the following XML leads to 4 file handles: <serial type='file'> <source path='/var/lib/nova/instances/7c0dcd78-.../console.log'/> <target port='0'/> <alias name='serial0'/> </serial> <console type='file'> <source path='/var/lib/nova/instances/7c0dcd78-.../console.log'/> <target type='serial' port='0'/> <alias name='serial0'/> </console> With that in mind and the target to support 4k guests by default we should raise the limit to 16k. Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com> --- src/logging/virtlogd.service.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/logging/virtlogd.service.in b/src/logging/virtlogd.service.in index ec7712b..aa9aa69 100644 --- a/src/logging/virtlogd.service.in +++ b/src/logging/virtlogd.service.in @@ -15,9 +15,11 @@ ExecReload=/bin/kill -USR1 $MAINPID OOMScoreAdjust=-900 # Need to have at least one file open per guest (eg QEMU # stdio log), but might be more (eg serial console logs) +# A common case is OpenStack which often has up to 4 file +# handles per guest. # libvirtd.service written to expect 4096 guests, so if we -# guess at 2 log files per guest here (stdio + 1 serial): -LimitNOFILE=8192 +# guess at 4 files per guest here that is 16k: +LimitNOFILE=16384 [Install] Also=virtlogd.socket -- 2.7.4

The assumption so far was an average of 4 disks per guest. But some architectures, like s390x, still often use plenty of smaller disks. To include those in the considerations an assumption of an average of 10 disks is more reasonable. Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com> --- src/locking/virtlockd.service.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.service.in index 928bf63..07e4847 100644 --- a/src/locking/virtlockd.service.in +++ b/src/locking/virtlockd.service.in @@ -15,8 +15,8 @@ ExecReload=/bin/kill -USR1 $MAINPID OOMScoreAdjust=-900 # Needs to allow for max guests * average disks per guest # libvirtd.service written to expect 4096 guests, so if we -# allow for 4 disks per guest, we get: -LimitNOFILE=16384 +# allow for 10 disks per guest, we get: +LimitNOFILE=40960 [Install] Also=virtlockd.socket -- 2.7.4

On 10/18/2017 11:19 AM, Christian Ehrhardt wrote:
In 27cd7635 new default limits were set: Author: Daniel P. Berrange <berrange@redhat.com> Date: Wed Mar 15 16:51:51 2017 +0000
Increase default file handle limits for daemons
But I faced some constraints with these values and think it is time to reconsider the defaults to only have to be tweaked in really uncommon cases.
Christian Ehrhardt (2): Increase default file handle limits for virtlogd Increase default file handle limits for virtlockd
src/locking/virtlockd.service.in | 4 ++-- src/logging/virtlogd.service.in | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-)
ACKed and pushed. Michal
participants (2)
-
Christian Ehrhardt
-
Michal Privoznik