Bug 33558 - Poor performance of libnss-db on large db files
Summary: Poor performance of libnss-db on large db files
Status: UNCONFIRMED
Alias: None
Product: glibc
Classification: Unclassified
Component: nss (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-21 05:41 UTC by Ponnuvel Palaniyappan
Modified: 2025-10-21 09:44 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
Project(s) to access:
ssh public key:


Attachments
Proposed patch (585 bytes, patch)
2025-10-21 06:40 UTC, Ponnuvel Palaniyappan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ponnuvel Palaniyappan 2025-10-21 05:41:25 UTC
libdnss-db opens and closes the DB file each time. This is normally not an issue as the DB files are small. This results in considerably poor performance when the DB files large (e.g. in an environment with 20k lines of DB file, the performance was 40times compared to keeping it open for processing all lines).

Rather than re-opening for scanning each line, the file can be kept open for each call into libnss as proposed in [1].


Reported elsewhere:

[0] https://bugs.launchpad.net/ubuntu/+source/libnss-db/+bug/2121543
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1101371
Comment 1 Ponnuvel Palaniyappan 2025-10-21 06:40:17 UTC
Created attachment 16429 [details]
Proposed patch

Attaching the proposed patch here. Also sent to glibc-alpha.