qemu-devel
[Top][All Lists]
Advanced

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

qemu-img: very bad performance with the default number of coroutines (8)


From: Claudio Fontana
Subject: qemu-img: very bad performance with the default number of coroutines (8) in presence of compression. Fixed adding "-m 1" to the cmdline.
Date: Mon, 18 Mar 2024 14:55:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0

Hello,

pretty much the $Subject.

We had reports of very bad performance with the default options when running:

$ time qemu-img convert -c -p -O qcow2 file.qcow2 file.disk
real    7m13.220s
user    6m56.682s
sys     0m13.038s

I studied this and noticed that for every coroutine a thread was created. But 
at no point ever were two coroutines making progress at the same time.
On the countrary, they constantly competed to run, leading to very slow task 
progress.

The workaround we found here was to just add "-m 1" to the command line, 
leading to a halving of the time taken for running the command:

$ time qemu-img convert -c --m 1 p -O qcow2 file.qcow2 file.disk
real    3m22.212s
user    3m13.744s
sys     0m7.881s

We repeated this test on a variety of hardware configurations, and the relative 
results are always the same.

Have you witnessed the same situation?

Should we change the default in qemu-img from 8 coroutines to 1, at least for 
the "-c" case?

In case I can submit a simple patch that does that, but looking forward for 
your thoughts.
It is possible that coroutines were added in an attempt to improve performance,
so maybe there is more here to fix, although in my view already fixing the 
existing bad default would already be a big improvement in the meantime.

Thoughts?

Thanks,

Claudio




reply via email to

[Prev in Thread] Current Thread [Next in Thread]