Hi all,
We currently have the problem that ApacheDS seems not to be able to handle 75
connections in parallel.
If I try an anonymous bind in 75 Threads in parallel, always 10 to 20 requests
fail with a ConnectException: Connection refused.
We are currently using version 1.5.3 but I tried also with 1.5.4 version. There
I saw a bit of improvement, sometimes I could get the 75 request to be executed
without errors, but most of the runs failed, too. With the same exception.
Are there any parameters on the ldapServer I can adjust? ThreadPool size or
something similar? Any ideas?
Thanks in advance,
Tanja
Exception:
javax.naming.CommunicationException: server:port [Root exception is
java.net.ConnectException: Connection refused]
at com.sun.jndi.ldap.Connection.<init>(Connection.java:204)
at com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:118)
at com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1578)
at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2596)
at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:283)
at
com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
at
com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
at
com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
at
com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.init(InitialContext.java:223)
at
javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:134)
at com.avid.uls.ParallelLogin$1LoginTask.run(ParallelLogin.java:28)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
at java.net.Socket.connect(Socket.java:520)
at java.net.Socket.connect(Socket.java:470)
at java.net.Socket.<init>(Socket.java:367)
at java.net.Socket.<init>(Socket.java:180)
at com.sun.jndi.ldap.Connection.createSocket(Connection.java:346)
at com.sun.jndi.ldap.Connection.<init>(Connection.java:181)
... 14 more
Test Code:
final Hashtable ldapEnvironment = new Hashtable();
ldapEnvironment.put("java.naming.provider.url","ldap://server:port/");
ldapEnvironment.put("java.naming.factory.initial","com.sun.jndi.ldap.LdapCtxFactory");
final List<Exception> errors = new ArrayList<Exception>();
// login
class LoginTask implements Runnable {
public void run() {
try {
new InitialLdapContext(ldapEnvironment, null);
} catch (Exception e) {
errors.add(e);
}
}
}
// trigger parallel logins
int amount = 110;
Collection<Thread> threads = new ArrayList<Thread>(amount);
for (int i = 0; i < amount; i++) {
Thread task = new Thread(new LoginTask());
task.start();
threads.add(task);
}
for (Thread thread : threads)
thread.join();
if(errors.size() > 0)
fail(errors.size() + " login problems out of " + amount + "
attempts");
Tanja Ertl, Senior Software Engineer
Avid Development GmbH, Paul-Heyse-Str 29, D-80336 München
http://www.avid.com <http://www.avid.com/> mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
Tel: +498950206871, Fax: +498950206819
Amtsgericht München HRB 155339, USt. ID. Nr. DE 814232828;
Geschäftsführer: Jochen Pielage, Jörg Tewes, Paige Parisi, Joel Legon