Skip to content

migration: add sztd compression

Denis Plotnikov qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3migration: rework compression code for adding more data compressorsmigration/migration.c migration/migration.h migration/qemu-file.c +3 more+236 -850 replies
2/3hmp: add compress-type parameter to migration parametershmp.c+8 -00 replies
3/3migration: add zstd compressionconfigure migration/migration.c migration/qemu-file.h +2 more+129 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/3] migration: add sztd compression

zstd date compression algorithm shows better performance on data compression. It might be useful to employ the algorithm in VM migration to reduce CPU usage. A user will be able to choose between those algorithms, therefor compress-type migration parameter is added.

Here are some results of performance comparison zstd vs gzip:

host: i7-4790 8xCPU @ 3.60GHz, 16G RAM migration to the same host
VM: 2xVCPU, 8G RAM total
5G RAM used, memory populated with postgreqsl data produced by pgbench performance benchmark

Threads: 1 compress – 1 decompress

zstd provides slightly less compression ratio with almost the same CPU usage but copes with RAM compression roghly 2 times faster

compression type zlib | zstd
---------------------------------------------------------

compression level          1       5     |   1       5
compression ratio          6.92    7.05  |   6.69    6.89
cpu idle, %                82      83    |   86      80
time, sec                  49      71    |   26      31

time diff to zlib, sec -25 -41

Threads: 8 compress – 2 decompress

zstd provides the same migration time with less cpu consumption

compression type none | gzip(zlib) | zstd
------------------------------------------------------------------------------

compression level        -     |  1      5       9    |   1       5       15
compression ratio        -     |  6.94   6.99    7.14 |   6.64    6.89    6.93
time, sec                154   |  22     23      27   |   23      23      25
cpu idle, %              99    |  45     30      12   |   70      52      23
cpu idle diff to zlib          |                      |  -25%    -22%    -11%

Denis Plotnikov (3):
migration: rework compression code for adding more data compressors
hmp: add compress-type parameter to migration parameters
migration: add zstd compression

 configure             |  26 ++++
 hmp.c                 |   8 ++
 migration/migration.c |  45 ++++++-
 migration/migration.h |   1 +
 migration/qemu-file.c |  39 ++----
 migration/qemu-file.h |  18 ++-
 migration/ram.c       | 291 ++++++++++++++++++++++++++++++++++--------
 qapi/migration.json   |  26 +++-
 8 files changed, 369 insertions(+), 85 deletions(-)
Signature · 1 line
2.17.0