[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
slapd 100% CPU usage !
Hello
I am running openldap 2.1.9, with bdb-backend (4.1.24). After starting
slapd, it takes nearly all the CPU usage :-( .
$ top
CPU states: 50.1% user, 49.8% system, 0.0% nice, 0.0% idle
Mem: 255300K av, 246444K used, 8856K free, 0K shrd, 19044K
buff
Swap: 265032K av, 30992K used, 234040K free 124604K
cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
1939 ldap 25 0 4260 4260 3080 R 96.0 1.6 5:43 slapd
I am wondering what slapd is doing so I run a strace:
$ strace -p 1939
sched_yield() = 0
sched_yield() = 0
sched_yield() = 0
....
infinite lines like these .
I did recreate my base from a ldif file (extracted with slapcat from a
2.0.25 openldap ldbm with berkeley database) and inserted with slapadd .
As it first took nearly an hour to do the slapadd, I did as recommended
in the list, create a DB_CONFIG file to optimise slapadd operation:
[root@corbeau /var/lib/ldap/int]
$ cat DB_CONFIG
#set the logfile size to 100MB.
set_lg_max 104857600
#set the in-memory log buffer size
set_lg_bsize 262144
#temporary while we're slapadding the database
set_flags DB_TXN_NOSYNC
#set the (per db?) cachesize to 0GB + X bytes, split into N pieces of memory
set_cachesize 0 209715200 2
Now I wonder if my problems comes from here ? I also see that we can put
these BDB options in slapd.conf file (cachesize <integer>, checkpoint
<kbyte> <min> , dbnosync ..) however they doesn't seem to be taken into
account while slapadding !? I really needed to create the DB_CONFIG file
to reduce time of insertion from 50 minutes to 45 seconds !.
What causes slapd to use 100% of CPU?
How should I optimize BDB performance (from DB_CONFIG file or slapd.conf) ?
Are the problems link ?
thanks.