[pve-devel] [RFC ha-manager] make static usage calculation faster
Fiona Ebner
f.ebner at proxmox.com
Fri Nov 18 12:32:20 CET 2022
by avoiding overhead from load_config().
Benchmarked recompute_online_node_usage() again with ~300 HA services
(minimal containers) running on my virtual test cluster.
Timings with 'basic' were between 0.0004 - 0.002 seconds
(a bit worse today than last time)
Timings before these patches were between 0.007 - 0.016 seconds
(also a bit worse than last time)
Timings after these patches were between 0.0035 - 0.006 seconds
So only about twice as fast unfortunately. Reducing the number of
recompute_online_node_usage() calls might be necessary after all.
Probably not worth applying, as this didn't get much testing and is
not a huge improvement :/
Fiona Ebner (3):
resources: get static stats: add cache parameter
env: add get_static_guest_stats method
manager/usage: cache static service stats to avoid overhead
src/PVE/HA/Env.pm | 6 ++++++
src/PVE/HA/Env/PVE2.pm | 15 +++++++++++++++
src/PVE/HA/Manager.pm | 1 +
src/PVE/HA/Resources.pm | 2 +-
src/PVE/HA/Resources/PVECT.pm | 5 +++--
src/PVE/HA/Resources/PVEVM.pm | 6 ++++--
src/PVE/HA/Sim/Env.pm | 7 +++++++
src/PVE/HA/Sim/Resources.pm | 2 +-
src/PVE/HA/Usage/Static.pm | 13 ++++++++++---
9 files changed, 48 insertions(+), 9 deletions(-)
--
2.30.2
More information about the pve-devel
mailing list