Menu

#10 caching of ldap lookups

open
None
3
2002-02-24
2002-02-19
No

version: cvs REL_0_8 18.02.02

I just had a closer look into my ldap access log
and was quite suprised what I saw.

When pressing "edit mydomain.com" ispman does a HUGE bunch of ldap lookups.
I counted 21 (twentyone!) successive wildcard LDAP searches in ou=conf AND
21 LDAP searches for ispmanVar=installDir:

slapd[12476]: conn=1549 op=45 SRCH base="ou=conf, o=ispman" scope=0 filter="(objectClass=*)"
slapd[12476]: conn=1549 op=45 SEARCH RESULT tag=101 err=0 text=
slapd[12473]: conn=1549 op=46 SRCH base="ou=conf, o=ispman" scope=2 filter="(ispmanVar=installDir)"
slapd[12473]: conn=1549 op=46 SEARCH RESULT tag=101 err=0 text=
[---repeat this 20x---]

This makes 42 lookups!!! (Not mentioned the other lookups for the domain data)

Other operations in ispman are simmiliar.
Though, they are not repeating that much.

We should really think about caching this data to minimize the lookups.
Unfortunately, I'm no perl wiz, to make suggestions here.

For a small pain relief, you can insert this index to your slapd.conf, to at least speed up the
lookups a little bit.
=====================
index ispmanVar eq
=====================
Remember to do an "slapindex" after that, to actually build that index file.

Discussion

  • Atif Ghaffar

    Atif Ghaffar - 2002-02-20

    Logged In: YES
    user_id=7978

    I use the following indexes

    index objectClass eq
    index uid,sn,cn pres,eq,sub
    index uidnumber,gidnumber pres,eq
    index memberuid pres,eq
    index mail,mailLocalAddress,mailAlias pres,eq
    index ispmanVar,ispmanModule,ispmanVal eq

    I had caching code, which I removed because it was providing
    some problems.
    Example: when the value of ispmanVar changes, there was no
    effect. I will look into this and try to fix it for 0.9

     
  • Atif Ghaffar

    Atif Ghaffar - 2002-02-24
    • assigned_to: nobody --> madmag
     
  • Atif Ghaffar

    Atif Ghaffar - 2002-02-24

    Logged In: YES
    user_id=7978

    I have added some code to do caching of conf_vars.
    Please update ISPMan.pm

    also please add
    $Config->{'installDir'} = "/path/to/ispman";
    in your ispman.conf

    I have not tested this under mod_perl yet.
    In future, I want to have a shared_memory cache or a disk
    cache. Will look into adding it into 0.9

     
  • Kris Amy

    Kris Amy - 2003-08-18

    Logged In: YES
    user_id=844238

    Why not just use NSCD?

     

Log in to post a comment.

MongoDB Logo MongoDB