From: <ma...@mj...> - 2001-04-02 23:27:53
|
The best of all possible worlds would be to use a Virtual List View control. However, if you're LDAP server doesn't support the VLV (I haven't played much with Net::LDAP VLV control to verify it working in all instances), the only option you have is to search as the directory super user (which it sounds like you are). The trick would probably be to use the callback option: $ldap->search( ... callback => \&callback) sub callback { my ($msg,$entry) = @_; if ($entry ref 'Net::LDAP::Entry') { #do something $mesg->shift_entry(); #remove from memory } } should be able to process each entry as its recieved and not run out of memory :). Mark On 3 Apr 01, at 9:05, David Richards wrote: > OK: > > perl -v produces: > This is perl, version 5.005_03 built for alpha-dec_osf > > uname -a prduces: > OSF1 tu01m2.qut.edu.au V5.1 732 alpha > > and perl-ldap is: > perl-ldap-0.22 > > I am attempting to retrieve about 120 000 entries, retrieving 5 > attributes, which are (just for an idea of size): > > uid : typically 8 characters > mailUID : typically 89 characters > QUTmailbox : flag 'yes' or 'no' > mailboxQuota : Integer, most cases is 10000 > cn : Normal common names. > > The script is an account maintenance script for our central mail > system, to manage the active IMAP accounts, just for a bit of context. > > Thanks, > > Clif Harden wrote: > > > > > > > > Graham, > > > > > > Can you help me out here. I am trying to retrieve a lot of > > > entries that causes the Perl-LDAP library to produce 'Out of > > > memory!' and fall over. What is the best way to retrieve the > > > entries? Have you got some sample code? > > > > A little more information may help. > > > > What version of perl, perl-ldap, system OS. > > > > How many entries are you trying to get: 1000, 10000, 100000. > > > > Regards, > > > > Clif > > > > > > > > Thanks, > > > > > > Dave. > > > > > > > > > Graham Barr wrote: > > > > > > > > On Thu, Mar 29, 2001 at 09:07:37AM +1000, David Richards wrote: > > > > > printf( "Searching...\n" ); > > > > > $count = 0; > > > > > $res = $ldap->search( base => $LDAP_BASE, filter => > > > > > "(objectclass=QUTmailPerson)", > > > > > attrs => ['uid', 'mailUID', > > > > > 'QUTmailbox', > > > > > 'mailboxQuota', 'cn' ], > > > > > callback => &LDAP_callback() ); > > > > > > > > That needs to be \&LDAP_callback > > > > > > > > In its current form you are calling the function and passing its > > > > results to ->search() which is NOT what you want. > > > > > > > > Graham. > > > > > > -- > > > David Richards > > > Project Manager (Messaging) > > > Information Technology Services > > > Queensland University of Technology > > > > > > > > -- > David Richards > Project Manager (Messaging) > Information Technology Services > Queensland University of Technology > > > Mark Wilcox ma...@mj... Got LDAP? |
From: David R. <d.r...@qu...> - 2001-04-03 01:31:39
|
Thankyou, it seems some slight and I mean very slight modification has this working now. Thank you to all those that helped me out here. Dave. ma...@mj... wrote: > > The best of all possible worlds would be to use a Virtual List View > control. > > However, if you're LDAP server doesn't support the VLV (I haven't > played much with Net::LDAP VLV control to verify it working in all > instances), the only option you have is to search as the directory > super user (which it sounds like you are). > > The trick would probably be to use the callback option: > > $ldap->search( > ... > callback => \&callback) > > sub callback { > my ($msg,$entry) = @_; > > if ($entry ref 'Net::LDAP::Entry') > { > #do something > $mesg->shift_entry(); #remove from memory > } > } > > should be able to process each entry as its recieved and not run > out of memory :). > > Mark > On 3 Apr 01, at 9:05, David Richards wrote: > > > OK: > > > > perl -v produces: > > This is perl, version 5.005_03 built for alpha-dec_osf > > > > uname -a prduces: > > OSF1 tu01m2.qut.edu.au V5.1 732 alpha > > > > and perl-ldap is: > > perl-ldap-0.22 > > > > I am attempting to retrieve about 120 000 entries, retrieving 5 > > attributes, which are (just for an idea of size): > > > > uid : typically 8 characters > > mailUID : typically 89 characters > > QUTmailbox : flag 'yes' or 'no' > > mailboxQuota : Integer, most cases is 10000 > > cn : Normal common names. > > > > The script is an account maintenance script for our central mail > > system, to manage the active IMAP accounts, just for a bit of context. > > > > Thanks, > > > > Clif Harden wrote: > > > > > > > > > > > Graham, > > > > > > > > Can you help me out here. I am trying to retrieve a lot of > > > > entries that causes the Perl-LDAP library to produce 'Out of > > > > memory!' and fall over. What is the best way to retrieve the > > > > entries? Have you got some sample code? > > > > > > A little more information may help. > > > > > > What version of perl, perl-ldap, system OS. > > > > > > How many entries are you trying to get: 1000, 10000, 100000. > > > > > > Regards, > > > > > > Clif > > > > > > > > > > > Thanks, > > > > > > > > Dave. > > > > > > > > > > > > Graham Barr wrote: > > > > > > > > > > On Thu, Mar 29, 2001 at 09:07:37AM +1000, David Richards wrote: > > > > > > printf( "Searching...\n" ); > > > > > > $count = 0; > > > > > > $res = $ldap->search( base => $LDAP_BASE, filter => > > > > > > "(objectclass=QUTmailPerson)", > > > > > > attrs => ['uid', 'mailUID', > > > > > > 'QUTmailbox', > > > > > > 'mailboxQuota', 'cn' ], > > > > > > callback => &LDAP_callback() ); > > > > > > > > > > That needs to be \&LDAP_callback > > > > > > > > > > In its current form you are calling the function and passing its > > > > > results to ->search() which is NOT what you want. > > > > > > > > > > Graham. > > > > > > > > -- > > > > David Richards > > > > Project Manager (Messaging) > > > > Information Technology Services > > > > Queensland University of Technology > > > > > > > > > > > > -- > > David Richards > > Project Manager (Messaging) > > Information Technology Services > > Queensland University of Technology > > > > > > > > Mark Wilcox > ma...@mj... > Got LDAP? -- David Richards Project Manager (Messaging) Information Technology Services Queensland University of Technology |