Depending on the JVM, this might not work, but I don't suppose the patch
would break anything, so it might be worth including it until a better
solution is implemented.
Though if the Sampler does not attempt to re-use connections at the moment,
perhaps it would be better to close the connection as part of the sample?
{perhaps excluding it from the time taken)
==
The TestListener interface has a testStopped() method (or similar); this is
called once per test in each ThreadGroup, IIRC. Controllers can implement a
static Collection to keep track of such resources, and then close them down
in the testStopped() method. (Or is it testFinished() - whatever). There
might need to be a Collection per ThreadGroup.
I think one of the Samplers already implements something like this. (JDBC?)
The current testStopped() behaviour is intentional, and probably cannot be
changed without breaking existing code.
S.
-----Original Message-----
From: Mcgladrey, Kayne [mailto:[EMAIL PROTECTED]
Sent: 27 October 2003 18:39
To: [EMAIL PROTECTED]
Subject: Proposed patch to LdapClient.java
Hello,
I'm new to the dev. list and don't have CVS access. My apologies if this is
the wrong way to propose a patch, but I didn't want to check in code that'll
probably break something else. This patch works for me. Your mileage will
vary.
Reason for patch:
The disconnect() method of LdapClient.java depends on garbage collection.
Java garbage collection is not frequent enough for heavy load testing and
it's possible to easily overwhelm the number of connections to a LDAP
server. In testing, I found that 1,099 connections could be easily held open
by fifty threads.
Suggested patch:
Force garbage collection on disconnect(). There's a client-side performance
hit for this. However, it's nowhere near as significant as the server-side
performance degradation from the aforementioned behavior. With the patch,
each operation opens a connection, sends the operation, gets the results,
and closes the connection. There really should be an option to keep a
connection open for n+1 LDAP operations; however, this is a quick hack that
works.
Actual code:
public void disconnect() {
try {
dirContext.close();
Runtime.getRuntime().gc();
Runtime.getRuntime().runFinalization();
} catch (Exception e) {
log.error("Ldap client - ",e);
}
}
Regards,
Kayne McGladrey
AT&T Wireless
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]