From owner-freebsd-questions Thu Oct 15 14:15:18 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA05572 for freebsd-questions-outgoing; Thu, 15 Oct 1998 14:15:18 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA05559 for ; Thu, 15 Oct 1998 14:15:14 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.1/8.9.1) id QAA09250; Thu, 15 Oct 1998 16:14:43 -0500 (CDT) Date: Thu, 15 Oct 1998 16:14:43 -0500 From: Dan Nelson To: elias@pro.via-rs.com.br, freebsd-questions@FreeBSD.ORG Subject: Re: pwd_mkdb performance Message-ID: <19981015161443.A8607@emsphone.com> References: <36269592.153E@pro.via-rs.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.94.3i In-Reply-To: <36269592.153E@pro.via-rs.com.br>; from "Elias Alexandre Argenton" on Thu Oct 15 17:38:42 GMT 1998 X-OS: FreeBSD 2.2.7-STABLE Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Oct 15), Elias Alexandre Argenton said: > We have: > - one Pentium 200 PRO with 128 MB of memory running FREEBSD 2.2.5 > - a master/passwd with 15.000 entries > > When we run pwd_mkdb it takes about 10 minutes with full cpu > utilization. Is this correct? It seams very very wrong. pwd_mkdb uses a small cache size by default (only 2MB) when building the .db files. in 3.0, there is a -s # option that resizes the cache to # meg. Here's the patch, which should be pretty easy to apply to the pwd_mkdb source: -Dan Nelson dnelson@emsphone.com Index: pwd_mkdb.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/pwd_mkdb/pwd_mkdb.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- pwd_mkdb.c 1998/02/19 08:12:11 1.24 +++ pwd_mkdb.c 1998/04/19 07:15:34 1.25 @@ -114,7 +114,7 @@ strcpy(prefix, _PATH_PWD); makeold = 0; username = NULL; - while ((ch = getopt(argc, argv, "Cd:pu:v")) != -1) + while ((ch = getopt(argc, argv, "Cd:ps:u:v")) != -1) switch(ch) { case 'C': /* verify only */ Cflag = 1; @@ -124,6 +124,9 @@ break; case 'p': /* create V7 "file.orig" */ makeold = 1; + break; + case 's': /* change default cachesize */ + openinfo.cachesize = atoi(optarg) * 1024 * 1024; break; case 'u': /* only update this record */ username = optarg; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message