]> git.proxmox.com Git - pve-cluster.git/commit
pmxcfs: add IPC call to get multiple guest config properties at once
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 16 Nov 2022 15:47:55 +0000 (16:47 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 17 Nov 2022 09:01:55 +0000 (10:01 +0100)
commit73a318239137fb70a13cb8aa7d0a92e13d50ebf8
tree05a205451b18ddb4a5422d9ea9b260d3d6c039e3
parent55d19f3f7d84aef85d8fef5ff1a4c92c5b62e01a
pmxcfs: add IPC call to get multiple guest config properties at once

Previously we used the existing IPC call just for getting the `lock`
property of virtual guests in the cluster resource API call, but for
the tag display we'll to get another one and calling this twice seems
rather non-ideal.

Thus introduce a successor: CFS_IPC_GET_GUEST_CONFIG_PROPERTIES

It allows one to get multiple properties from a single, or all
virtual guest in-memory configs in one go. Keep the existing IPC call
as is for backward compatibility and add this as separate, new one.

The new IPC command basically behaves the same as the previous
CFS_IPC_GET_GUEST_CONFIG_PROPERTY, but takes a list of properties
instead and returns multiple properties per guest.

The existing perl wrapper around the IPC call to get a single
property was switched over to use the new IPC call too, so we'll
be able to drop the old IPC command with the next major release if
nothing comes up.

= Benchmark =

== Setup ==

Proxmox VE in a VM with CPU type host (Intel 12700k) and 4 cores
10000 typical configs with both 'lock' and 'tags' set at the end, and
fairly long tags ('test-tag1,test-tag2,test-tag3') (normal VM with a
snapshot, ~ 1 KiB)

== Test ==

Average of 100 runs each with time in milliseconds

== Previous Results ==

num props  total time  time per iteration
1          1054.2      10.2

== Results with this Patch ==

num props  total time  time per iter  function
2          1332.2      13.2           get_properties
1          1051.2      10.2           get_properties
2          2082.2      20.2           get_property, 2 separate calls
1          1034.2      10.2           get_property

So, a call with the new code for one property is the same as with the
old code, and adding a second property only adds a bit of additional
time (in this case ~30%).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ T: reword & re-structure commit message ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/src/cfs-ipc-ops.h
data/src/server.c
data/src/status.c
data/src/status.h