Re: [Cpu-users] Slow user creation
Brought to you by:
matheny
From: Blake M. <bma...@pu...> - 2003-09-24 21:01:09
|
In cpu.conf, change RANDOM = "false" to RANDOM = "true". You will no longer get a linear search for IDs (e.g. if the next unused ID is X you will most likely not get to use X) but it will drop that time significantly. If you notice in the log below, it is doing a linear search hitting 5537, 5538, 5539.... until an unused ID is found. Change RANDOM to true will hit an unused ID quickly as a seeded rand() is used to generate an integer value between MAX_UIDNUMBER and MIN_UIDNUMBER. You could also change MIN_UIDNUMBER/MIN_GIDNUMBER to a number higher than the largest number in your directory, but this probably is not a good way to fix things. In the future, CPU will probably need to cache the last number used for a linear search, and start from that position the next time a useradd/groupadd takes place. Let me know if that fixes things. -Blake Whatchu talkin' 'bout, Willis? > I am noticing that when adding new users the command take a considerable > amount of time to come back. Presumably this is as the result of > searching for unused gid or uid. > > From my slapd log. > > Sep 24 13:21:01 llama slapd[2434]: conn=1630 op=1062 SRCH attr=gidNumber > Sep 24 13:21:01 llama slapd[2434]: conn=1630 op=1062 SEARCH RESULT > tag=101 err=0 nentries=1 text= > Sep 24 13:21:01 llama slapd[2443]: conn=1630 op=1063 SRCH > base="ou=Group,dc..." scope=2 filter="(gidNumber=5537)" > Sep 24 13:21:01 llama slapd[2443]: conn=1630 op=1063 SRCH attr=gidNumber > Sep 24 13:21:01 llama slapd[2443]: conn=1630 op=1063 SEARCH RESULT > tag=101 err=0 nentries=1 text= > Sep 24 13:21:01 llama slapd[4906]: conn=1630 op=1064 SRCH > base="ou=Group,dc..." scope=2 filter="(gidNumber=5538)" > > It can take 30 seconds to add a users and moments to delete one. Is > there anyway to speed this up? Either via some additional indexing in > OpenLDAP or changes to the config file for cpu? > > I do not necessarily need to re-use user ids as my number of users is > only in the hundreds range. As a note I start at 5000. > > Terrence > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Cpu-users mailing list > Cpu...@li... > https://lists.sourceforge.net/lists/listinfo/cpu-users -- Blake Matheny "... one of the main causes of the fall of the bma...@pu... Roman Empire was that, lacking zero, they had http://www.mkfifo.net no way to indicate successful termination of http://ovmj.org/GNUnet/ their C programs." --Robert Firth |