From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 131391FF15E for ; Mon, 27 Oct 2025 10:25:21 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D73F61EDFC; Mon, 27 Oct 2025 10:25:49 +0100 (CET) Message-ID: <9b2293ec-9440-40ce-91f2-a04381942129@proxmox.com> Date: Mon, 27 Oct 2025 10:25:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Daniel Kral , Proxmox VE development discussion References: <20251020164540.517231-1-d.kral@proxmox.com> <20251020164540.517231-13-d.kral@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761557105636 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.020 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH ha-manager v2 8/8] implement static service stats cache X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" 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