useradd is cpu and memory hog

From: Jerry Berkman <jerry_at_violet.berkeley.edu>
Date: Wed, 16 Jul 1997 16:18:54 -0700 (PDT)

At UC Berkeley on the main email server, we have a system whereby
students, faculty fill out a Web form, and then new email accounts
are created every few hours automatically. We used to do this
with homegrown code which changed /etc/passwd and created the tcb files
(e.g. /tcb/files/auth/j/jerry for logon "jerry"). This program
took a negligible amount of cpu time.

When we upgraded to Digital UNIX 4.0B, we switched from the home-grown
code to the new DEC "useradd" command. This worked with no problems.
However we had some problems with the new DEC "usermod" command,
which we thought might be cured by switching to the data base format
for the auth files (/tcb/files/auth.db and /var/tcb/files/auth.db).

This turned out not to be the case; the problem with "usermod" is it
wouldn't read any password entries after the first null line in
/etc/passwd! So I did vipw and deleted the null lines.
Ever since, useradd has taken about 190 cpu seconds per new account
on our Alpha 2100 4/275.

% acctcom -n useradd

ACCOUNTING RECORDS FROM: Tue Jul 15 23:55:01 1997 PDT
COMMAND START END REAL CPU MEAN
NAME USER TTYNAME TIME TIME (SECS) (SECS) SIZE(K)
#useradd root ? 11:40:16 11:44:26 250.37 189.03 29327360.00
#useradd root ? 11:44:31 11:48:49 258.37 195.20 30875648.00
#useradd root ? 11:48:56 11:52:48 232.12 190.23 30035968.00
#useradd root ? 13:40:14 13:44:33 259.00 195.25 30593024.00
#useradd root ? 13:44:40 13:48:44 244.87 196.17 30957568.00

In mid August, we will be adding 500-600 new accounts per day. At 190
cpu sec per account, useradd will use over 20 hours of cpu time each day!
Plus it is a big memory hog.

Has anyone else experienced this? Is there a fix? If not, we will
need to back out the data base version of the auth files. Any advice
on the best way to do that?

        - Jerry Berkman, UCBerkeley, jerry_at_uclink, (510)642-4804
Received on Thu Jul 17 1997 - 01:38:40 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:36 NZDT