You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Michael Bauroth <Mi...@falcom.de> on 2006/12/21 22:58:07 UTC

Limitations on open sessions?

Hi,

I currently write an internal test tool for different connection 
scenarios. In this context I found a strange behaviour and don't know 
exactly, where it comes from. After creating 28230 connections with 
client and server on same machine (so I have twice open connections) the 
client doesn't open more connections. I work on a Debian 3.1 system, the 
ulimit is set to unlimited connections. Here is a short code snippet for 
that case:

for ( int i = 0; i < tConnectionCount; i++ )
{
   ConnectFuture tFuture = mConnector.connect( mBindAdress );
   tFuture.join();
     		
   if ( !tFuture.isConnected() )
     System.out.println("error c");
   if ( !tFuture.isReady() )
     System.out.println("error r");
}

The program prints exactly after the mentioned number the "error c" 
message and also wait and retry loops doesn't change anything here.

Has anyone perhaps an idea about that?

Best Regards
Michael

Re: Limitations on open sessions?

Posted by Vinod Panicker <vi...@gmail.com>.
On 12/22/06, Trustin Lee <tr...@gmail.com> wrote:
> On 12/22/06, Vinod Panicker <vi...@gmail.com> wrote:
> >
> > On 12/22/06, Michael Bauroth <mi...@falcom.de> wrote:
> > > Hi Vinod,
> > >
> > > that's the solution! I called ulimit with the wrong parameter. ulimit -n
> > > gives me 50000 as result, so now it's clear.
> > >
> > > Remaining my second question, but this one I will discuss in the other
> > > thread so far.
> >
> > Rather than calling ulimit each time, just make the necessary entries
> > in /etc/security/limits.conf on a Debian system.
> >
> > If you enter something like this -
> >
> > * soft nofile 100000
> > * hard nofile 100000
> >
> > And reboot, all users on the system will have an open file limit of 100k
>
>
> Hey, isn't it too big? :)
>
> It would be great if you managed to make MINA handle that amount of
> connections in production environment.  If so, please let us know!

It is very much possible to handle these many connections.  The
limitations are currently imposed by the hardware and the JVM
implementation of epoll.  If you remember my earliest tests, we were
able to reach 100k connected sessions using MINA.  Doing I/O is
another matter, though.

Regards,
Vinod.

Re: Limitations on open sessions?

Posted by Trustin Lee <tr...@gmail.com>.
On 12/22/06, Vinod Panicker <vi...@gmail.com> wrote:
>
> On 12/22/06, Michael Bauroth <mi...@falcom.de> wrote:
> > Hi Vinod,
> >
> > that's the solution! I called ulimit with the wrong parameter. ulimit -n
> > gives me 50000 as result, so now it's clear.
> >
> > Remaining my second question, but this one I will discuss in the other
> > thread so far.
>
> Rather than calling ulimit each time, just make the necessary entries
> in /etc/security/limits.conf on a Debian system.
>
> If you enter something like this -
>
> * soft nofile 100000
> * hard nofile 100000
>
> And reboot, all users on the system will have an open file limit of 100k


Hey, isn't it too big? :)

It would be great if you managed to make MINA handle that amount of
connections in production environment.  If so, please let us know!

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: Limitations on open sessions?

Posted by Vinod Panicker <vi...@gmail.com>.
On 12/22/06, Michael Bauroth <mi...@falcom.de> wrote:
> Hi Vinod,
>
> that's the solution! I called ulimit with the wrong parameter. ulimit -n
> gives me 50000 as result, so now it's clear.
>
> Remaining my second question, but this one I will discuss in the other
> thread so far.

Rather than calling ulimit each time, just make the necessary entries
in /etc/security/limits.conf on a Debian system.

If you enter something like this -

* soft nofile 100000
* hard nofile 100000

And reboot, all users on the system will have an open file limit of 100k

Regards,
Vinod.

Re: Limitations on open sessions?

Posted by Michael Bauroth <mi...@falcom.de>.
Hi Vinod,

that's the solution! I called ulimit with the wrong parameter. ulimit -n 
gives me 50000 as result, so now it's clear.

Remaining my second question, but this one I will discuss in the other 
thread so far.

Thank you very much
Michael

Vinod Panicker schrieb:
> On 12/22/06, Michael Bauroth <Mi...@falcom.de> wrote:
>> Hi,
>>
>> I currently write an internal test tool for different connection
>> scenarios. In this context I found a strange behaviour and don't know
>> exactly, where it comes from. After creating 28230 connections with
>> client and server on same machine (so I have twice open connections) the
>> client doesn't open more connections. I work on a Debian 3.1 system, the
>> ulimit is set to unlimited connections. Here is a short code snippet for
>> that case:
>>
>> for ( int i = 0; i < tConnectionCount; i++ )
>> {
>>    ConnectFuture tFuture = mConnector.connect( mBindAdress );
>>    tFuture.join();
>>
>>    if ( !tFuture.isConnected() )
>>      System.out.println("error c");
>>    if ( !tFuture.isReady() )
>>      System.out.println("error r");
>> }
>>
>> The program prints exactly after the mentioned number the "error c"
>> message and also wait and retry loops doesn't change anything here.
>>
>> Has anyone perhaps an idea about that?
> 
> What is the output of "ulimit -n"?  Make sure you are running ulimit
> under the same user that you are running the test app in.
> 
> Regards,
> Vinod.


Re: Limitations on open sessions?

Posted by Vinod Panicker <vi...@gmail.com>.
On 12/22/06, Michael Bauroth <Mi...@falcom.de> wrote:
> Hi,
>
> I currently write an internal test tool for different connection
> scenarios. In this context I found a strange behaviour and don't know
> exactly, where it comes from. After creating 28230 connections with
> client and server on same machine (so I have twice open connections) the
> client doesn't open more connections. I work on a Debian 3.1 system, the
> ulimit is set to unlimited connections. Here is a short code snippet for
> that case:
>
> for ( int i = 0; i < tConnectionCount; i++ )
> {
>    ConnectFuture tFuture = mConnector.connect( mBindAdress );
>    tFuture.join();
>
>    if ( !tFuture.isConnected() )
>      System.out.println("error c");
>    if ( !tFuture.isReady() )
>      System.out.println("error r");
> }
>
> The program prints exactly after the mentioned number the "error c"
> message and also wait and retry loops doesn't change anything here.
>
> Has anyone perhaps an idea about that?

What is the output of "ulimit -n"?  Make sure you are running ulimit
under the same user that you are running the test app in.

Regards,
Vinod.