You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Tanja Ertl <Ta...@avid.com> on 2008/10/20 11:09:53 UTC

parallel binds

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:tanja_ertl@avid.com <ma...@avid.com> 
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

 


RE: parallel binds

Posted by Tanja Ertl <Ta...@avid.com>.
Hi Emmanuel,

That explains the behavior I have seen. I will add a JIRA entry.

Thanks for your help!
Tanja 

-----Original Message-----
From: Emmanuel Lecharny [mailto:elecharny@gmail.com] 
Sent: Montag, 20. Oktober 2008 14:10
To: users@directory.apache.org
Subject: Re: parallel binds

Tanja Ertl wrote:
> Hi Emmanuel,
>
> My client fails already with 75 requests, I don't think that this is overwhelmed compared to 900 requests from 9 different machines.
> How did your client setup look like? If I introduce a delay of 5 ms between the Threads startup, all seems to work fine. The problem seems to be that the request arrive all exactly at the same time.
>   
Then it makes sense. The server have a backlog of 50 connections, so if 
all your 75 clients are sending requests exactly at the same time, then 
you will get some failures. However, this is not exactly a real life 
example.

I would suggest that you introduce a ramp up period, where each client 
connects every 100 ms, for instance.

If you could create a JIRA for this problem, we can consider adding a 
configurable backlog in the server.

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: parallel binds

Posted by Emmanuel Lecharny <el...@gmail.com>.
Tanja Ertl wrote:
> Hi Emmanuel,
>
> My client fails already with 75 requests, I don't think that this is overwhelmed compared to 900 requests from 9 different machines.
> How did your client setup look like? If I introduce a delay of 5 ms between the Threads startup, all seems to work fine. The problem seems to be that the request arrive all exactly at the same time.
>   
Then it makes sense. The server have a backlog of 50 connections, so if 
all your 75 clients are sending requests exactly at the same time, then 
you will get some failures. However, this is not exactly a real life 
example.

I would suggest that you introduce a ramp up period, where each client 
connects every 100 ms, for instance.

If you could create a JIRA for this problem, we can consider adding a 
configurable backlog in the server.

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



RE: parallel binds

Posted by Tanja Ertl <Ta...@avid.com>.
Hi Emmanuel,

My client fails already with 75 requests, I don't think that this is overwhelmed compared to 900 requests from 9 different machines.
How did your client setup look like? If I introduce a delay of 5 ms between the Threads startup, all seems to work fine. The problem seems to be that the request arrive all exactly at the same time.

Bye,
Tanja

-----Original Message-----
From: Emmanuel Lecharny [mailto:elecharny@gmail.com] 
Sent: Montag, 20. Oktober 2008 12:30
To: users@directory.apache.org
Subject: Re: parallel binds

Tanja Ertl wrote:
> No, I didn't. I just tried from one machine 75 requests in parallel.
> I could try, but I don't see how that would change the situation. Are there any restrictions that only x connections per host are allowed?
no. Asd I said, we have tested the server to absorb something like 900 
request in //. So maybe your client (with 100 threads) is a bit overwhelmed.

Btw, there is a parameter on the server to set the number of threads 
handling incoming requests :
  <standardThreadPool id="standardThreadPool" maxThreads="8"/>

You can change this number. (the more processor you have on your server, 
the higher the number of thread you can use).

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: parallel binds

Posted by Emmanuel Lecharny <el...@gmail.com>.
Tanja Ertl wrote:
> No, I didn't. I just tried from one machine 75 requests in parallel.
> I could try, but I don't see how that would change the situation. Are there any restrictions that only x connections per host are allowed?
no. Asd I said, we have tested the server to absorb something like 900 
request in //. So maybe your client (with 100 threads) is a bit overwhelmed.

Btw, there is a parameter on the server to set the number of threads 
handling incoming requests :
  <standardThreadPool id="standardThreadPool" maxThreads="8"/>

You can change this number. (the more processor you have on your server, 
the higher the number of thread you can use).

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



RE: parallel binds

Posted by Tanja Ertl <Ta...@avid.com>.
No, I didn't. I just tried from one machine 75 requests in parallel.
I could try, but I don't see how that would change the situation. Are there any restrictions that only x connections per host are allowed? 

-----Original Message-----
From: Emmanuel Lecharny [mailto:elecharny@gmail.com] 
Sent: Montag, 20. Oktober 2008 11:48
To: users@directory.apache.org
Subject: Re: parallel binds

Tanja Ertl wrote:
> 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.
>   
Strange. We have tested ADS with 9 injectors, each one of us having a 
hundred clients, without any problem. Have you tried to spread the 
clients on more than one computer ?

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: parallel binds

Posted by Emmanuel Lecharny <el...@gmail.com>.
Tanja Ertl wrote:
> 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.
>   
Strange. We have tested ADS with 9 injectors, each one of us having a 
hundred clients, without any problem. Have you tried to spread the 
clients on more than one computer ?

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org