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 47D2D1FF138 for ; Mon, 01 Jun 2026 14:32:26 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 060E41C46C; Mon, 1 Jun 2026 14:32:26 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup 0/4] fix 7642: s3: avoid expensive uid/gid lookups Date: Mon, 1 Jun 2026 14:31:20 +0200 Message-ID: <20260601123124.461765-1-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1780317074531 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.063 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 T_SPF_PERMERROR 0.01 SPF: test of record failed (permerror) Message-ID-Hash: 4SKRPAFNNGNC7HUQKBHAGULTFJSPVR4S X-Message-ID-Hash: 4SKRPAFNNGNC7HUQKBHAGULTFJSPVR4S 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: 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. [0] https://forum.proxmox.com/threads/s3-gc-phase-2-nsswitch-passwd-overhead.183709/ [1] https://bugzilla.proxmox.com/show_bug.cgi?id=7642 Christian Ebner (4): local datastore cache: combine same module use statements datastore/api: s3: wrap s3 client into s3 backend type datastore: s3: avoid double calls to rather expensive backup_user() fix #7642: s3: avoid repeated user lookup for per-chunk file locking pbs-config/src/lib.rs | 30 +- pbs-datastore/src/backup_info.rs | 64 +++-- pbs-datastore/src/chunk_store.rs | 33 ++- pbs-datastore/src/datastore.rs | 262 +++++++++++------- pbs-datastore/src/lib.rs | 2 +- pbs-datastore/src/local_chunk_reader.rs | 19 +- .../src/local_datastore_lru_cache.rs | 14 +- src/api2/config/datastore.rs | 62 ++--- src/api2/reader/mod.rs | 13 +- src/backup/verify.rs | 4 +- src/server/pull.rs | 10 +- 11 files changed, 304 insertions(+), 209 deletions(-) -- 2.47.3