Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 May 2000 22:06:22 +0200 (CEST)
From:      Andrzej Bialecki <abial@webgiro.com>
To:        seva@mtelecom.ru
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: what is /etc/[s]pwd.db stay for?
Message-ID:  <Pine.BSF.4.20.0005092157190.99125-100000@mx.webgiro.com>
In-Reply-To: <Pine.BSF.4.01.10005091856540.14288-100000@gw2>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 9 May 2000, Vsevolod Semenov wrote:

> 
> pw showuser shows user tens times slowly then 
> grep user /etc/[master.]passwd 

DB files provide you with already parsed and indexed information, more
suitable for use in API. grep can't perform many operations from getpw*
family... also, the library routines getpw* would have to parse
/etc/passwd each time you call them...

Try to increase hashsize when using pw and related utilities. It makes a
real difference in speed for large user databases.
 
> 
> pwd_mkdb can't create [s]pwd.db files for 1000000 users.

I believe we still have a limit of 65535 user ids in many places in the
system, although uid_t is in fact u_int32_t. Or...?

> 
> what reason to use db stuff in libc/gen/getpwent.c?

Speed and efficiency :-)

Andrzej Bialecki

//  <abial@webgiro.com> WebGiro AB, Sweden (http://www.webgiro.com)
// -------------------------------------------------------------------
// ------ FreeBSD: The Power to Serve. http://www.freebsd.org --------
// --- Small & Embedded FreeBSD: http://www.freebsd.org/~picobsd/ ----




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.20.0005092157190.99125-100000>