[tpop3d-discuss] open sockets...

prune prune at lecentre.net
Mon, 10 Jun 2002 11:51:39 +0200


--------------040709060606090104090404
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Michael Klatsky wrote:

>Chris & Prune-
>
>First of all- I want to say a big thanks for all your help in
>implementing DARC, and in addressing the segfault on incorrect password
>issue.
>
>It looks like there is one issue that I see- and I believe it's a
>"solaris" ism as I haven't seen much about the issue...
>
>I have a system (my "semi-production" system)  which has 3 regular
>users. Doing an lsof shows 241 open tpop3d connections in either
>CLOSE_WAIT (63) or ESTABLISHED (177). These have been open for quite
>awhile (hours).
>
>This seems quite high, and I would believe that tpop isn't releasing the
>connections to the ldap server. Some output:
>
>tpop3d     418     root  236u  IPv4 0x30001500e10     0t697    TCP
>mail:33263->mail:ldap             
> (ESTABLISHED)
>tpop3d     418     root  237u  IPv4 0x30001500050     0t792    TCP
>mail:33271->mail:ldap             
> (ESTABLISHED)
>tpop3d     418     root  238u  IPv4 0x3000155be60     0t697    TCP
>mail:33272->mail:ldap             
> (ESTABLISHED)
>tpop3d     418     root  239u  IPv4 0x3000150e908     0t792    TCP
>mail:33275->mail:ldap             
> (ESTABLISHED)
>tpop3d     418     root  240u  IPv4 0x30001568e18     0t697    TCP
>mail:33276->mail:ldap             
> (ESTABLISHED)
>
>I'm currently looking into the Solaris tuning aspects too, and I'll give
>some feedback on that.
>
>M
>

241 opened socket for 3 clients ?
:)

you (normaly) can't do anything about CLOSE_WAIT .... this is system 
related.
then, tpop3d have 177 opened socket to the ldap server.... this is a 
problem.
Normaly tpop3d use (and re-use) the same connection... so I believe the 
same socket.
If this happen, it's probably because you're re-connecting to the server 
for every pop you do.
is there a  relation between the number of sockets and the number of 
times you popped mail ?

I saw Chris released some patch for connecting every time you pop.... 
did you apply it ?

from openldap man page :

UNBINDING <http://www.openldap.org/software/man.cgi?query=ldap_unbind_ext&sektion=3&apropos=0&manpath=OpenLDAP+2.0-Release#end>
       The ldap_unbind() call is used to unbind from  the  direc-
       tory,  terminate  the  current  association,  and free the
       resources contained in  the  ld	structure.   Once  it  is
       called,	the  connection to the LDAP server is closed, and
       the ld structure is invalid.  The ldap_unbind_s() call  is
       just  another  name for ldap_unbind(); both of these calls
       are synchronous in nature.

As the unbind function is associated to the bind function (and not to 
the ldap_connect or ldap_init), I'm not pretty sure the connection (the 
TCP) is dropped. Normaly you should be able to unbind and re-bind after 
that.... (unbinding makes you anonymous...).
maybe there's a bug here.
I'll try to test that if I have some time.

Could you send me the auth_ldap.c/.h files you used on you pre-prod server ?

Cheers,

Prune

>
>
>
>
>On Sat, 2002-06-08 at 17:04, Michael Klatsky wrote:
>
>>Drac is working in a test environment...:)
>>
>>I'll be dropping it into a (semi) production environment and see how it
>>goes- I'll let you know.
>>
>>One thing to note- make sure that libdrac.a is in your LD_LIBRARY_PATH,
>>otherwise confgure won't pick it up.
>>
>>M
>>
>>
>><snip>
>>


--------------040709060606090104090404
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<html>
<head>
</head>
<body>
Michael Klatsky wrote:<br>
<blockquote type="cite" cite="mid:1023669023.18850.19.camel@superjoshua.localdomain">
  <pre wrap="">Chris &amp; Prune-<br><br>First of all- I want to say a big thanks for all your help in<br>implementing DARC, and in addressing the segfault on incorrect password<br>issue.<br><br>It looks like there is one issue that I see- and I believe it's a<br>"solaris" ism as I haven't seen much about the issue...<br><br>I have a system (my "semi-production" system)  which has 3 regular<br>users. Doing an lsof shows 241 open tpop3d connections in either<br>CLOSE_WAIT (63) or ESTABLISHED (177). These have been open for quite<br>awhile (hours).<br><br>This seems quite high, and I would believe that tpop isn't releasing the<br>connections to the ldap server. Some output:<br><br>tpop3d     418     root  236u  IPv4 0x30001500e10     0t697    TCP<br>mail:33263-&gt;mail:ldap             <br> (ESTABLISHED)<br>tpop3d     418     root  237u  IPv4 0x30001500050     0t792    TCP<br>mail:33271-&gt;mail:ldap             <br> (ESTABLISHED)<br>tpop3d     418     root  238u  IPv4 0x300015
5be60     0t697    TCP<br>mail:33272-&gt;mail:ldap             <br> (ESTABLISHED)<br>tpop3d     418     root  239u  IPv4 0x3000150e908     0t792    TCP<br>mail:33275-&gt;mail:ldap             <br> (ESTABLISHED)<br>tpop3d     418     root  240u  IPv4 0x30001568e18     0t697    TCP<br>mail:33276-&gt;mail:ldap             <br> (ESTABLISHED)<br><br>I'm currently looking into the Solaris tuning aspects too, and I'll give<br>some feedback on that.<br><br>M</pre>
  </blockquote>
  <br>
241 opened socket for 3 clients ?<br>
:)<br>
  <br>
you (normaly) can't do anything about CLOSE_WAIT .... this is system related.<br>
then, tpop3d have 177 opened socket to the ldap server.... this is a problem.<br>
Normaly tpop3d use (and re-use) the same connection... so I believe the same
socket.<br>
If this happen, it's probably because you're re-connecting to the server
for every pop you do.<br>
is there a &nbsp;relation between the number of sockets and the number of times
you popped mail ?<br>
  <br>
I saw Chris released some patch for connecting every time you pop.... did
you apply it ?<br>
  <br>
from openldap man page : <br>
  <br>
  <pre><a name="UNBINDING" href="http://www.openldap.org/software/man.cgi?query=ldap_unbind_ext&amp;sektion=3&amp;apropos=0&amp;manpath=OpenLDAP+2.0-Release#end"><b>UNBINDING</b></a>
       The <b>ldap_unbind()</b> call is used to unbind from  the  direc-
       tory,  terminate  the  current  association,  and free the
       resources contained in  the  <b>ld</b>	structure.   Once  it  is
       called,	the  connection to the LDAP server is closed, and
       the <b>ld</b> structure is invalid.  The <b>ldap_unbind_s()</b> call  is
       just  another  name for <b>ldap_unbind()</b>; both of these calls
       are synchronous in nature.</pre>
As the unbind function is associated to the bind function (and not to the
ldap_connect or ldap_init), I'm not pretty sure the connection (the TCP)
is dropped. Normaly you should be able to unbind and re-bind after that....
(unbinding makes you anonymous...).<br>
maybe there's a bug here.<br>
I'll try to test that if I have some time.<br>
  <br>
Could you send me the auth_ldap.c/.h files you used on you pre-prod server
?<br>
  <br>
Cheers,<br>
  <br>
Prune<br>
  <br>
  <blockquote type="cite" cite="mid:1023669023.18850.19.camel@superjoshua.localdomain">
    <pre wrap=""><br><br><br><br>On Sat, 2002-06-08 at 17:04, Michael Klatsky wrote:<br></pre>
    <blockquote type="cite">
      <pre wrap="">Drac is working in a test environment...:)<br><br>I'll be dropping it into a (semi) production environment and see how it<br>goes- I'll let you know.<br><br>One thing to note- make sure that libdrac.a is in your LD_LIBRARY_PATH,<br>otherwise confgure won't pick it up.<br><br>M<br><br><br>&lt;snip&gt;<br></pre>
      </blockquote>
      </blockquote>
      <br>
      </body>
      </html>

--------------040709060606090104090404--