OK, I think I've fixed the extended sampler so that contexts are always closed.

Seems to be OK when tested against slapd running locally. Netstat
shows only  connections in TIME_WAIT at the end of a test - this is
normal.

The current nightly build has the fixes in it if you want to try it out.

S.
On 7/9/05, sebb <[EMAIL PROTECTED]> wrote:
> The JNDI tutorial has a section on connections and pooling:
> 
> http://java.sun.com/products/jndi/tutorial/ldap/connect/index.html
> 
> This says that connections need be closed using Context.close().
> 
> AFAICS JMeter only calls Context.close() for the unbind() test - it
> does not attempt to close all contexts at the end of a test, which it
> ought to do. I'll see about fixing this.
> 
> The context is shared amongst all the samplers in the same thread.
> However, if/when the context is updated, the previously saved context
> (if any) is not closed. I'll fix this.
> 
> Presumably the idea is that a test plan should be designed so each
> thread calls BIND once at the start, and UNBIND once at the end. Every
> other call can be repeated, and would use the same context. If the
> test plan does not do this, then one or more contexts (and
> connections) will be left unclosed.
> 
> So does your test plan have more than one bind per thread?
> 
> Also, LdapExtClient.sbind() creates an InitialDirContext but never uses it.
> Since this is supposed to be a bind/unbind test, failure to disconnect
> is a bug (which I'll fix).
> 
> BTW, JDK 1.4+ provides connection pooling, where the pool is shared
> amongst all threads in the same JVM.  However JMeter threads are used
> to simulate independent users, so it seems to me that this would not
> be appropriate here.
> 
> S.
> On 7/7/05, Peter Lin <[EMAIL PROTECTED]> wrote:
> > I don't have a lot of experience with various JNDI drivers, but if the
> > problem really is the jndi driver, there isn't much we can do besides
> > use a different jndi driver.  so far I've only had to use jndi to
> > lookup EJB and JMS.  It's been a while since I've had to use LDAP
> > service and lookup it up through jndi.
> >
> > peter
> >
> >
> > On 7/7/05, sebb <[EMAIL PROTECTED]> wrote:
> > > I'm not familiar with JNDI, sorry. Perhaps others (Peter?) know the 
> > > answer.
> > >
> > > There's a similar problem with the default HttpURLConnection (no
> > > control over connection re-use), which is partly why we added the
> > > Apache HTTPCLient sampler.
> > >
> > > S.
> > > On 7/7/05, Smits.Dolf <[EMAIL PROTECTED]> wrote:
> > > > Hi,
> > > >
> > > > It seems that the JNDI interface is not closing the connections.
> > > > It seems that this is a (un)known feature of the javax.naming package, 
> > > > as it
> > > > seems to happen as wel with other jndi packages.
> > > >
> > > > So it's not related to jMeter.
> > > > (unless you know a way to "manually" find out information about a 
> > > > socket and
> > > > close that somewhere in the code)
> > > > (i'm using the extended ldap sampler)
> > > >
> > > > Dolf
> > > >
> > > > -----Original Message-----
> > > > From: sebb [mailto:[EMAIL PROTECTED]
> > > > Sent: Thursday, July 07, 2005 12:51
> > > > To: JMeter Users List
> > > > Subject: Re: Problem with connections
> > > >
> > > >
> > > > On 7/6/05, Smits.Dolf <[EMAIL PROTECTED]> wrote:
> > > > > Hi all,
> > > > >
> > > > > Im running Jmeter on a local machine, generating a severe load on the
> > > > > server.
> > > > > The tests fail because the server is getting to much connections.
> > > > >
> > > > > I use a thread group, existing of 95 threads.
> > > > > The thread group contains a loop controller which loops 100 times. In 
> > > > > the
> > > > > loop, a connection is setup, some requests are performed, and the
> > > > connection
> > > > > is closed.
> > > > >
> > > > > To my understanding, in the loop, the next request is sent as the 
> > > > > previous
> > > > > request is received, so I should end up with maximum 95 connections.
> > > >
> > > > The existing samplers work on the request-response principle, and a
> > > > thread will not continue until the sampler has read the response (or
> > > > it timed or or failed etc).
> > > >
> > > > > OR, wil the loop send out all requests as fast as possible, without
> > > > waiting
> > > > > for responses? In that case I could indeed end up with 95*100 =9.500
> > > > > connections to the server.
> > > >
> > > > No.
> > > >
> > > > > If my understanding is correct, the problem is in the closing of the
> > > > > connections.
> > > >
> > > > Perhaps.
> > > >
> > > > > Has anyone experience with JMeter not closing the connections 
> > > > > properly, or
> > > > > the server not closing the connections properly and can he/she give me
> > > > some
> > > > > hints how to handle this problem.
> > > > >
> > > > > I/m using the LDAP protocol, so this is not stateless but is 
> > > > > depending on
> > > > a
> > > > > session.
> > > >
> > > > Not sure how the LDAP Sampler handles connection closure/re-use.
> > > >
> > > > BTW, which one are you using?
> > > >
> > > > > I'm running both the server and the client on a 8cpu SUN solaris 10 
> > > > > server
> > > > > with 48 Gb memory.
> > > > >
> > > > > Any hints are welcome.
> > > > >
> > > > > Dolf
> > > > >
> > > > > Dolf Smits
> > > > > Senior Consultant Meta Directory Solutions
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to