From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 364E41FF0C0 for ; Wed, 04 Nov 2026 17:36:50 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 571932138C; Wed, 04 Nov 2026 17:36:47 +0100 (CET) Message-ID: Date: Wed, 4 Nov 2026 17:36:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH pve-firewall 3/3] fix #1965: firewall: cache cluster config To: pve-devel@lists.proxmox.com References: <20261104141931.399659-1-a.bied-charreton@proxmox.com> <20261104141931.399659-4-a.bied-charreton@proxmox.com> Content-Language: en-US From: Stefan Hanreich In-Reply-To: <20261104141931.399659-4-a.bied-charreton@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.315 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: UEXHYPNQZTMNVNHDCAMKH22QR6MJBLW2 X-Message-ID-Hash: UEXHYPNQZTMNVNHDCAMKH22QR6MJBLW2 X-MailFrom: s.hanreich@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 11/4/26 3:20 PM, Arthur Bied-Charreton wrote: > Large firewall configs can take a noticeable amount of time to parse, > as noted by the user on the linked issue. > > Register the config with cfs_register_file in order to avoid re-parsing > it unless cluster.fw changed. > > Rule verification still depends on the SDN config, which can change > independently. A rule referencing an SDN ipset that did not exist when > it was parsed and cached is still stored with errors, even if that rule > becomes valid later (e.g. if the rule references 'foo-dhcp' and the > VNet 'foo' is created later). > > For this reason, the cached config keeps the SDN config it was verified > against last time it was fully parsed. If the ipset names yielded by the > current SDN config differ from what is stored, all cluster and group > rules are re-verified against the new ones. The ccache cannot be > invalidated from pve-firewall, so after an SDN change this happens on > every load until cluster.fw is parsed again due to a new version or a > daemon restart. > > Errors found on re-verification are logged to preserve the original > behavior. > > Benchmark with two 25k-entry ipsets and 1050 rules (50 loads): > > without caching: > first load 0.2447s, then avg 0.2509s (min 0.2301 max 0.2835) > > cached, not re-verified (steady state): > first load 0.2694s, then avg 0.0157s (min 0.0131 max 0.0204) > > cached, re-verified (worst case, transient until next parse): > avg 0.0721s (min 0.0657 max 0.1012) That is with eea1b88b9 applied already? In that case the gain seems marginal? Are there other possible configurations that would get a bigger speed up. Because the core problem seems to be addressed with eea1b88b9 alone and then we don't have the added logic of re-verifying / caching?