[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
openldap 2.1.3 libraries and udp
I'm having a curious problem that's left me completely stumped. I have installed the openldap 2.1.3 libraries (no slapd or slurpd) for use with PHP. I am having a problem with UDP sockets being created and not going away.
The problem seems to be with calling ldap_bind from PHP. Whenever I do this, a UDP socket is established from and to localhost. There is, of course, also a TCP connection made to the LDAP server (which is on another machine), and that is working just fine. In PHP, ldap_unbind and ldap_close are aliases for the same function. Still, I've tried calling both of them, and none of them remove this UDP connection.
One new UDP connection is created for each ldap_bind, and this connection never goes away, unless I stop httpd (httpd -> PHP -> openldap libs). It's by chance I noticed that this was occuring when I had some sloppy code that made hundreds of bind calls. Soon my page wasn't loading and when I went over to the Linux box it told me that too many files were open. Sure enough apache had hundreds of FDs for all these UDP connections. (Funny thing though, I had been running this code for awhile and this issue should have cropped up before it did... I don't think I changed anything...)
Example:
I run a script that calls ldap_bind (and also ldap_unbind, but that doesn't seem to have any impact) several times and this happens:
# netstat | grep udp | wc -l
122
122 udp sockets established! Maybe four or five of those aren't caused from running the script. All these connections look like this (just imagine a lot more):
udp 0 0 localhost.localdom:3837 localhost.locald:domain ESTABLISHED
udp 0 0 localhost.localdom:3836 localhost.locald:domain ESTABLISHED
udp 0 0 localhost.localdom:3835 localhost.locald:domain ESTABLISHED
udp 0 0 localhost.localdom:3834 localhost.locald:domain ESTABLISHED
udp 0 0 localhost.localdom:3833 localhost.locald:domain ESTABLISHED
I've waited several hours and they don't go away
I'm completely stumped. I've also tried an older ver. of openldap (2.0.25) with the same behavior. Why are UDP connections being created at all? Why don't they go away? Where in the code should I look if I have to hack it myself? Any ideas?
This is how I have openldap configured:
./configure --prefix=/usr/local/openldap --disable-slapd --disable-slurpd --enable-static --enable-shared --with-gnu-ld
Ben