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 138441FF146 for ; Tue, 23 Jun 2026 12:29:27 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E32361F312; Tue, 23 Jun 2026 12:29:25 +0200 (CEST) Message-ID: <12cb3da0-9228-4036-aa95-4a4ccc2b850b@proxmox.com> Date: Tue, 23 Jun 2026 12:28:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-backup 0/4] fix 7642: s3: avoid expensive uid/gid lookups To: =?UTF-8?Q?Fabian_Gr=C3=BCnbichler?= , pbs-devel@lists.proxmox.com References: <20260601123124.461765-1-c.ebner@proxmox.com> <1781783962.ps1il2f5oc.astroid@yuna.none> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <1781783962.ps1il2f5oc.astroid@yuna.none> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1782210521276 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.068 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 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: ILRZPVFQIMXA4H7QRBEVLVSBXFMB4X7Q X-Message-ID-Hash: ILRZPVFQIMXA4H7QRBEVLVSBXFMB4X7Q X-MailFrom: c.ebner@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 Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 6/18/26 2:00 PM, Fabian Grünbichler wrote: > On June 1, 2026 2:31 pm, Christian Ebner wrote: >> As reported by a user in the community forum [0] and the thereof >> resulting bugzilla entry [1], phase 2 of garbage collection currently >> produces avoidable syscalls and parsing overhead, reading >> /etc/nsswitch.conf and /etc/passwd for each per-chunk file locking >> call. This is however not limited to garbage collection, but rather >> affects per-chunk file locking in general. The backup_user() lookup >> was identified as the culprit. >> >> This patch series fixes the overhead by only reading the user once at >> the start of garbage collection or whenever a s3 backend instance is >> created (which already performs the user lookup anyways), storing it >> for the rest of the backend lifetime. > > couldn't we implement this with less churn, and fix it for *all* call > sites, by caching the resolved user? if it changes during the execution > of our daemon we have a problem anyway, so might as well treat it as > static (initialized in a lazy fashion)? > > same for priv_user and backup_group.. Yes, will implement it as such then: Was unsure if acceptable to break with the assumption that this is no longer read on-demand, so opted for the less invasive approach. But reading on-demand would be racy anyways and I see no further reason why this should not be treated as statically initialized. Will adapt accordingly and send a new version. Thanks for your feedback!