Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Oct 1998 16:14:43 -0500
From:      Dan Nelson <dnelson@emsphone.com>
To:        elias@pro.via-rs.com.br, freebsd-questions@FreeBSD.ORG
Subject:   Re: pwd_mkdb performance
Message-ID:  <19981015161443.A8607@emsphone.com>
In-Reply-To: <36269592.153E@pro.via-rs.com.br>; from "Elias Alexandre Argenton" on Thu Oct 15 17:38:42 GMT 1998
References:  <36269592.153E@pro.via-rs.com.br>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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