From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id A01051FF165 for ; Thu, 23 Oct 2025 18:19:56 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B5A98EBB6; Thu, 23 Oct 2025 18:20:22 +0200 (CEST) Mime-Version: 1.0 Date: Thu, 23 Oct 2025 18:19:48 +0200 Message-Id: From: "Daniel Kral" To: "Proxmox VE development discussion" X-Mailer: aerc 0.20.0 References: <20251020164540.517231-1-d.kral@proxmox.com> <20251020164540.517231-13-d.kral@proxmox.com> In-Reply-To: <20251020164540.517231-13-d.kral@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761236380503 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.015 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" 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. 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? > + next if defined($stats->{$id}); > + > + $stats->{$id} = {}; > + } > + > + return $stats; > + }; > + $self->log('warning', "unable to update static service stats cache - $@") if $@; > + > + $self->{static_service_stats} = $service_stats; > +} _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel