Batch Input with Python-Ldap

Michael Ströder michael at stroeder.com
Tue Oct 12 17:37:59 CEST 2004


Christian Klinger wrote:
> 
> I have a question about adding a large numbers of users to ldap with 
> python_ldap!

This seems not specific to python-ldap. I will try to answer though.

> I think the problem is the second part of the script. I put every member 
> in the group ENMS!
> If I run the script without part two it runs 5 Minuts with it runs much 
> longer.

Depending on the machine running the LDAP client you could try to build a 
list of all users and pass this list to l.modify_s(gdn,..). Then you would 
only send one big modify request instead of a modify request for each user.

> Is this the right way to make an batch import?
> Do you have any tips to make it faster?
> I test it with 50.000 User but in production there should be 500.000 - 
> Is this a problem?

Generally speaking group entries with more than 1000 member attribute values 
does not scale very well. The exact limit varies depending on the LDAP 
server product and configuration. I'd avoid that. You should really think 
about it. But that's more a question of LDAP directory design in general and 
hence more suitable to be asked in a general LDAP forum.

Ciao, Michael.



More information about the python-ldap mailing list