misc/75855: getpwent functions on 5.3 with large password file
extremely slow
Bruce Campbell
bruce at engmail.uwaterloo.ca
Wed Jan 5 07:50:47 PST 2005
>Number: 75855
>Category: misc
>Synopsis: getpwent functions on 5.3 with large password file extremely slow
>Confidential: no
>Severity: non-critical
>Priority: high
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Jan 05 15:50:46 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Bruce Campbell
>Release: 5.3-RELEASE
>Organization:
University of Waterloo
>Environment:
FreeBSD ecserv14.uwaterloo.ca 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Fri Dec 24 12:26:55 EST 2004 root at ecserv14.uwaterloo.ca:/usr/src/sys/i386/compile/SMP i386
>Description:
getpwnam or getpwuid on our system with over 10,000 entries
in /etc/master.passwd is slow and uses alot of resources.
>How-To-Repeat:
Create an /etc/master.passwd with 10,000 entries.
Run this program:
#include <sys/types.h>
#include <pwd.h>
main( int argc, char *argv[] )
{
getpwnam( "someid" );
}
if run with truss, it can be seen doing 1,000 to 100,000
repetitions of
lseek(3,0x5d3000,SEEK_SET) = 6107136 (0x5d3000)
read(0x3,0x8061000,0x1000) = 4096 (0x1000)
lseek(3,0x5d4000,SEEK_SET) = 6111232 (0x5d4000)
read(0x3,0x8062000,0x1000) = 4096 (0x1000)
where file handle 3 is /etc/spwd.db
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list