Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Jan 2005 15:48:42 GMT
From:      Bruce Campbell <bruce@engmail.uwaterloo.ca>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/75855: getpwent functions on 5.3 with large password file extremely slow
Message-ID:  <200501051548.j05Fmgqn067410@www.freebsd.org>
Resent-Message-ID: <200501051550.j05FoksP050911@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501051548.j05Fmgqn067410>