[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: speed of LDAP?



>>>>> "Jeremy" == Jeremy T Bouse <undrgrid@toons.UnderGrid.net> writes:

    Jeremy> Brian, Here's the same commands ran from my workstation
    Jeremy> against the LDAP running on another server (! 
    Jeremy> localhost)...

    Jeremy> real 0m0.475s user 0m0.070s sys 0m0.050s

    Jeremy>  real 0m0.114s user 0m0.030s sys 0m0.080s

much faster. What version of slapd did you use?


For me, the version is stable is much faster then unstable.  This is
the main reason I am concerned.

STABLE VERSION WITHOUT NSCD:

[507] [snoopy:bam] ~ >time w   
  4:01pm  up 27 days, 20:19, 20 users,  load average: 0.48, 0.41, 0.19
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT
w  0.02s user 0.06s system 7% cpu 1.137 total

[508] [snoopy:bam] ~ >time id bam
uid=1003(bam) gid=1003(bam) groups=1003(bam),20(dialout),21(fax),24(cdrom),25(floppy),29(audio),33(www-data),40(src),100(users),200(comsoft),201(printer),202(wheel),203(winsoft)
id bam  0.01s user 0.01s system 8% cpu 0.240 total

w is faster (although still IMHO slow), and id is acceptable.


Installing nscd like some suggest improves the speed of both
operations operation, but they still are very slow (in comparison to
your results).

UNSTABLE WITHOUT NSCD:

[511] [snoopy:bam] ~ >time w         
  4:05pm  up 27 days, 20:23, 20 users,  load average: 0.49, 0.39, 0.22
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT
w  0.06s user 0.05s system 0% cpu 13.469 total
[512] [snoopy:bam] ~ >time id bam
uid=1003(bam) gid=1003(bam) groups=1003(bam),20(dialout),21(fax),24(cdrom),25(floppy),29(audio),33(www-data),40(src),100(users),200(comsoft),201(printer),202(wheel),203(winsoft)
id bam  0.05s user 0.00s system 1% cpu 3.568 total

w is 12 times slower, and it id is 15 times slower.


UNSTABLE WITH NSCD:

[513] [snoopy:bam] ~ >time w     
  4:06pm  up 27 days, 20:24, 20 users,  load average: 0.27, 0.35, 0.21
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT
w  0.03s user 0.06s system 5% cpu 1.751 total
[514] [snoopy:bam] ~ >time w
  4:06pm  up 27 days, 20:24, 20 users,  load average: 0.41, 0.38, 0.22
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT
w  0.02s user 0.07s system 15% cpu 0.574 total

[514] [snoopy:bam] ~ >time id bam
uid=1003(bam) gid=1003(bam) groups=1003(bam),20(dialout),21(fax),24(cdrom),25(floppy),29(audio),33(www-data),40(src),100(users),200(comsoft),201(printer),202(wheel),203(winsoft)
id bam  0.00s user 0.03s system 1% cpu 1.826 total
[515] [snoopy:bam] ~ >time id bam
uid=1003(bam) gid=1003(bam) groups=1003(bam),20(dialout),21(fax),24(cdrom),25(floppy),29(audio),33(www-data),40(src),100(users),200(comsoft),201(printer),202(wheel),203(winsoft)
id bam  0.03s user 0.01s system 3% cpu 1.294 total

this is a bit better...


I tried logging debug level 1 in slapd (2 and 16 looked interesting too,
but didn't seem to do anything).  I got really confused when it
started logging irrelevant stuff for the above requests, eg:

[repeat for all ou=Services]

79]: ====> cache_find_entry_id( 441 ) "cn=qotd+ipServiceProtocol=tcp,ou=Services) (1 tries) 
79]: <= id2entry_r( 441 ) 0x8196b80 (cache) 
79]: => string_expand: pattern:  uid=root,ou=People,dc=chocbit,dc=org,dc=au 
79]: => string_expand: expanded: uid=root,ou=People,dc=chocbit,dc=org,dc=au 
79]: => regex_matches: string:    
79]: => regex_matches: rc: 1 no matches 
79]: ldbm_search: candidate 441 does not match filter 
79]: ====> cache_return_entry_r( 441 ): returned (0) 
79]: => id2entry_r( 442 ) 

[repeat for all ou=Protocols]

[repeat for all ou=Hosts]

and no, my computer shouldn't be using LDAP instead of /etc/services
or /etc/protocols or /etc/hosts. Is this behaviour normal?


If I kill slapd and only have nscd running, things are very fast:

[517] [snoopy:bam] ~ >time id bam   
uid=1003(bam) gid=1003(bam) groups=1003(bam),20(dialout),21(fax),24(cdrom),25(floppy),29(audio),33(www-data),40(src),100(users),200(comsoft),201(printer),202(wheel),203(winsoft)
id bam  0.01s user 0.02s system 79% cpu 0.038 total
[517] [snoopy:bam] ~ >time id bam
uid=1003(bam) gid=1003(bam) groups=1003(bam),20(dialout),21(fax),24(cdrom),25(floppy),29(audio),33(www-data),40(src),100(users),200(comsoft),201(printer),202(wheel),203(winsoft)
id bam  0.01s user 0.02s system 93% cpu 0.032 total
-- 
Brian May <bam@debian.org>



Reply to: