Re: Slow LDAP Queries
xyzzy
Date: 12/17/03
- Next message: Justin Patrin: "Re: [PHP] Re: saving resource objects"
- Previous message: xyzzy: "Re: strange!"
- In reply to: Phil Dowson: "Slow LDAP Queries"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 16 Dec 2003 23:09:06 -0500
"Phil Dowson" <webmaster@aea9.k12.ia.us> wrote in message
news:20031216160200.24417.qmail@pb1.pair.com...
> Hi,
>
> I am using ldap_bind to connect to an Active Directory server to
> authenticate users on a website. Although the script is running,
> occasionally, and at random, the process to authenticate the user will
take
> almost exactly 75 seconds (within 100ths of a second). Other times the
> authentication process will take less than a second.
>
> Is there any way to see what is causing the delay, does anyone know which
> logs I should be looking at. The webserver is a FreeBSD box, and the
Domain
> controller is a Windows 2000 box.
>
> PHP Version: 4.3.4
> Apache Version: 1.3.29
> FreeBSD: 5.1
> Open LDAP: openldap-client-2.0.27
>
> My code is below.
>
> <?
> $ldapuser = "username";
> $ldappass = "password";
>
> //Script Time Debug -- START
> $mtime = microtime();
> $mtime = explode(" ",$mtime);
> $mtime = $mtime[1] + $mtime[0];
> $starttime = $mtime;
> //Script Time Debug -- START
>
> $ldaprdn = 'DOMAINNAME\\'.$ldapuser;
> $ldapconn = @ldap_connect("dns.domain.com", 3268);
> @ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
> @ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0);
>
> if ($ldapconn) {
> $ldapbind = @ldap_bind($ldapconn, $ldaprdn, $ldappass);
> if ($ldapbind) {echo "you are logged in";}
> else {echo "you are not logged in";}
> ldap_close($ldapconn);
> }
>
> //Script Time Debug -- END
> $mtime = microtime();
> $mtime = explode(" ",$mtime);
> $mtime = $mtime[1] + $mtime[0];
> $endtime = $mtime;
> $totaltime = ($endtime - $starttime);
> echo ("<script type='text/javascript'>alert('$totaltime')</script>");
> //Script Time Debug -- END
> ?>
>
> Thanks
>
> Phil Dowson
Hard to say.
I have used both Netscape & openldap servers without problems. Maybe
something with the M$ domain settings ? ...
I would try the command line ldapsearch utility that you have installed
first. This will possibly eliminate PHP as the culprit.
Also, you may want to try installing ethereal or some other packet sniffer.
- Next message: Justin Patrin: "Re: [PHP] Re: saving resource objects"
- Previous message: xyzzy: "Re: strange!"
- In reply to: Phil Dowson: "Slow LDAP Queries"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|