Subject: Re: yp performance
To: Charles M. Hannum <root@ihack.net>
From: Erik Rungi <blackbox@openface.ca>
List: current-users
Date: 11/22/1999 17:55:29
Hi!

David Brownlee helped me find another solution;

In the Makefile.yp

Change
                        ${CAT} ${.ALLSRC} | ${CUT} -d: -f1-4,8-10 | \
                        ${AWK} 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
                        { print $$1, $$0 }' - | ${MAKEDBM} - passwd.byname;

to

                        ${CAT} ${.ALLSRC} | ${CUT} -d: -f1-4,8-10 | \ 
			${AWK} 'BEGIN { FS=":"; OFS="\t"; } /^[a-zA-Z0-9_]/ \
                        { print $$1, $$0 }' - | ${SORT} | \
                        ${MAKEDBM} - passwd.byname;

A /usr/bin/sort has been added to the pipe.

From
http://cvsweb.netbsd.org/bsdweb.cgi/basesrc/usr.sbin/ypserv/ypinit/Makefile.yp

--
Revision 1.9 / (download) - annotate - [select for diffs] , Fri Nov 19
16:55:25 1999 UTC (3 days, 5 hours ago) by abs 
Branch: MAIN 
CVS Tags: HEAD 
Changes since 1.8: +31 -25 lines
Diff to previous 1.8 

Our db btree(3) implementation is tuned for ordered insertion, so pipe
through sort before makedbm.
This drops Erik Rungi's <rungus@openface.ca> passwd.byname generation for
3000 entries from 25-30 seconds down to 0.75 seconds.
--

I'll try your changes when I get a chance to see if they have a similar
effect.

Erik

On 22 Nov 1999, Charles M. Hannum wrote:

> 
> In src/usr.sbin/ypserv/common/ypdb.c, change:
> 
> 	info.cachesize = 0;
> 	info.maxkeyperpage = 0;
> 
> to:	
> 
> 	info.cachesize = 2 * 1024 * 1024;
> 	info.maxkeyperpage = 100;
> 
> and:
> 
> 	info.psize = 0;
> 
> to:
> 
> 	info.psize = 8192;
> 
> then rebuild everything in src/usr.sbin/ypserv, and see if it helps.
> 
> Please let me know either way.