From: Fiona Ebner <f.ebner@proxmox.com>
To: Daniel Kral <d.kral@proxmox.com>,
Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH ha-manager v2 8/8] implement static service stats cache
Date: Mon, 27 Oct 2025 10:25:16 +0100 [thread overview]
Message-ID: <9b2293ec-9440-40ce-91f2-a04381942129@proxmox.com> (raw)
In-Reply-To: <DDPU6Z6V1J58.1DF04LARQ37WE@proxmox.com>
Am 23.10.25 um 6:19 PM schrieb Daniel Kral:
> On Mon Oct 20, 2025 at 6:45 PM CEST, Daniel Kral wrote:
>> @@ -502,6 +504,39 @@ sub get_datacenter_settings {
>> };
>> }
>>
>> +sub get_static_service_stats {
>> + my ($self, $id) = @_;
>> +
>> + # undef if update_static_service_stats(...) failed before
>> + return undef if !defined($self->{static_service_stats});
>> +
>> + return $self->{static_service_stats}->{$id};
>> +}
>> +
>> +sub update_static_service_stats {
>> + my ($self) = @_;
>> +
>> + my $properties = ['cores', 'cpulimit', 'memory', 'sockets', 'vcpus'];
>> + my $service_stats = eval {
>> + my $stats = PVE::Cluster::get_guest_config_properties($properties);
>> +
>> + # get_guest_config_properties(...) doesn't add guests which do not
>> + # specify any of the given properties, but we need to make a distinction
>> + # between "not cached" and "not specified" here
>> + my $vmlist = PVE::Cluster::get_vmlist();
>> + for my $id (keys %$vmlist) {
>
> I'm sorry, this is obviously wrong, it should be
>
> my $vmlist = PVE::Cluster::get_vmlist() // {};
> my $idlist = $vmlist->{ids} // {};
> for my $id (keys %$idlist) {
>
> here. This will only result in performance degradation as all guests
> without any of the given guest config $properties specified will then
> fallback to reading their guest config directly.
Good catch! As we discussed off-list, the "// {}" for get_vmlist() is
unnecessary and since we do a cfs_update() in each iteration, the list
should be up-to-date too.
> If nothing else comes up until Tuesday I'll send a v3 or a follow up.
>
> @Fiona, can I still apply your R-b then?
Yes.
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-10-27 9:25 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 16:45 [pve-devel] [PATCH ha-manager/perl-rs/proxmox/qemu-server v2 00/12] Granular online_node_usage accounting Daniel Kral
2025-10-20 16:45 ` [pve-devel] [PATCH qemu-server v2 1/1] config: only fetch necessary default values in get_derived_property helper Daniel Kral
2025-10-21 11:47 ` [pve-devel] applied: " Fiona Ebner
2025-10-20 16:45 ` [pve-devel] [PATCH proxmox v2 1/1] resource-scheduling: change score_nodes_to_start_service signature Daniel Kral
2025-10-21 12:14 ` Fiona Ebner
2025-10-20 16:45 ` [pve-devel] [PATCH perl-rs v2 1/2] pve-rs: resource_scheduling: allow granular usage changes Daniel Kral
2025-10-20 16:45 ` [pve-devel] [PATCH perl-rs v2 2/2] test: resource_scheduling: use score_nodes helper to imitate HA Manager Daniel Kral
2025-10-21 12:14 ` Fiona Ebner
2025-10-20 16:45 ` [pve-devel] [PATCH ha-manager v2 1/8] manager: remove redundant recompute_online_node_usage from next_state_recovery Daniel Kral
2025-10-20 16:45 ` [pve-devel] [PATCH ha-manager v2 2/8] manager: remove redundant add_service_usage_to_node " Daniel Kral
2025-10-20 16:45 ` [pve-devel] [PATCH ha-manager v2 3/8] manager: remove redundant add_service_usage_to_node from next_state_started Daniel Kral
2025-10-20 16:45 ` [pve-devel] [PATCH ha-manager v2 4/8] rules: resource affinity: decouple get_resource_affinity helper from Usage class Daniel Kral
2025-10-21 13:02 ` Fiona Ebner
2025-10-23 8:20 ` Daniel Kral
2025-10-20 16:45 ` [pve-devel] [PATCH ha-manager v2 5/8] manager: make recompute_online_node_usage use add_service_usage helper Daniel Kral
2025-10-21 13:06 ` Fiona Ebner
2025-10-20 16:45 ` [pve-devel] [PATCH ha-manager v2 6/8] usage: allow granular changes to Usage implementations Daniel Kral
2025-10-20 16:45 ` [pve-devel] [PATCH ha-manager v2 7/8] manager: make online node usage computation granular Daniel Kral
2025-10-21 13:09 ` Fiona Ebner
2025-10-20 16:45 ` [pve-devel] [PATCH ha-manager v2 8/8] implement static service stats cache Daniel Kral
2025-10-21 13:23 ` Fiona Ebner
2025-10-23 16:19 ` Daniel Kral
2025-10-27 9:25 ` Fiona Ebner [this message]
2025-10-27 16:48 ` [pve-devel] superseded: [PATCH ha-manager/perl-rs/proxmox/qemu-server v2 00/12] Granular online_node_usage accounting Daniel Kral
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9b2293ec-9440-40ce-91f2-a04381942129@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=d.kral@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox