A Canonical Support engineer investigated a severe performance regression in Ubuntu's libnss-db library affecting environments with over 24,000 user and group entries. The root cause was a 12-year-old logic bug in how the library handled Berkeley DB connections during getent enumeration — instead of keeping the database open, it repeatedly opened and closed it, triggering 48,422 disk reads per enumeration. A patch forcing the connection to stay open resolved the issue. The case was escalated to Canonical Sustaining Engineering and a Launchpad bug was filed to upstream the fix. The story illustrates the value of Ubuntu Pro with Support subscriptions for resolving deep legacy code issues.

6m read timeFrom ubuntu.com
Post cover image
Table of contents
What went wrongStarting with the evidenceReproducing the slowdownDigging into legacy C codeThe line of code that matteredHow performance was restoredWhy this case stands out
245 Impressions