[pve-devel] [PATCH qemu-server 0/1] increase qemu max openfiles limit

Alexandre Derumier aderumier at odiso.com
Sun Dec 10 15:49:39 CET 2023


The current qemu max openfile limit is 1024.

This is really to low it you use ceph storage through librbd.

For each disk, qemu process is doing 1 tcp connection to each osd.

I have trigger a bug this week, a vm with 6 disk and a cluster with 100 osd,

At boot vm was working fine, but after some time, vm begin to do random disk access
timeout. The number of connection was around 600~700.
Also the qemu monitor/qemu-agent was hanging too.

Other users have also reported this bug:


This patch use prlimit command to increase the limit after vm start.
I don't have found a way to increase it in the qemu scope directly with LimitNOFILE.

Alternative fix is to increase max openfile globally with

if vm is launched through gui:

if vm is launched through ssh with qm:
root                -       nofile          524289

But maybe users could already have tuned it for containers,
so I think it's better to  only change limit for qemu process.

Alexandre Derumier (1):
  fix #4507 : increase qemu max openfiles limit

 PVE/QemuServer.pm | 6 ++++++
 1 file changed, 6 insertions(+)


More information about the pve-devel mailing list