ArchiveOrangemail archive

Netty Users


netty-users.lists.jboss.org
(List home) (Recent threads) (125 other JBoss Community lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe address with "subscribe" in the subject line, or visit the list's homepage here.
  • This list contains about 5,353 messages, beginning Aug 2008
  • This list doesn't seem to be active
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

Netty problem with large number of connections

Ad
Tomasz Lewandowski 1255953114Mon, 19 Oct 2009 11:51:54 +0000 (UTC)
Hello,

I have a simple HTTP Server implemented with Netty. 

I also have a stress test client (also written with Netty), which tries to
start 10'000 long living connections for receiving Comet-like notifications
(chunks of HTML in the form: "<script>....</script>", server writes about 50
chunks per second, so each simulated users gets a notification ones per 200
seconds). 

The client also generates aproximately 400 HTTP requests/connections (apart
from 10'000 long living connections) per second. 

Everything is fine when I run 1 instance of the stress client. But when I
try to run 2 instances on 2 different client machines (which would give me
total of 20'000 Comet-like connections), after about 18'000 connections
estabilished, I'm starting to get:

java.net.ConnectException: connection timed out
        at
org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processConnectTimeout(NioClientSocketPipelineSink.java:361)
        at
org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:273)
        at
org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)

My server works on 
Intel(R) Core(TM)2 Duo CPU     E4500  @ 2.20GHz
machine with 2GB RAM which is located in the same LAN as stress clients.

My server bootstrap code looks like this:
		ServerBootstrap bootstrap = new ServerBootstrap(
				new NioServerSocketChannelFactory(Executors
						.newCachedThreadPool(), Executors
						.newCachedThreadPool()));

I tried this on the server side:
bootstrap.setOption("backlog", 1000);
but it didn't help.

Can anyone give me a hint what should I do to resolve this problem?

Tomasz Lewandowski
AD 1256561050Mon, 26 Oct 2009 12:44:10 +0000 (UTC)
Hi,

Could it be due to an OS limitation in the number of open connections?
Which OS do you use?

David André
On Mon, Oct 19, 2009 at 12:52, Tomasz Lewandowski wrote: > > Hello, > > I have a simple HTTP Server implemented with Netty. > > I also have a stress test client (also written with Netty), which tries to > start 10'000 long living connections for receiving Comet-like notifications > (chunks of HTML in the form: "<script>....</script>", server writes about 50 > chunks per second, so each simulated users gets a notification ones per 200 > seconds). > > The client also generates aproximately 400 HTTP requests/connections (apart > from 10'000 long living connections) per second. > > Everything is fine when I run 1 instance of the stress client. But when I > try to run 2 instances on 2 different client machines (which would give me > total of 20'000 Comet-like connections), after about 18'000 connections > estabilished, I'm starting to get: > > java.net.ConnectException: connection timed out > at > org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processConnectTimeout(NioClientSocketPipelineSink.java:361) > at > org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:273) > at > org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > > My server works on > Intel(R) Core(TM)2 Duo CPU E4500 @ 2.20GHz > machine with 2GB RAM which is located in the same LAN as stress clients. > > My server bootstrap code looks like this: > ServerBootstrap bootstrap = new ServerBootstrap( > new NioServerSocketChannelFactory(Executors > .newCachedThreadPool(), Executors > .newCachedThreadPool())); > > I tried this on the server side: > bootstrap.setOption("backlog", 1000); > but it didn't help. > > Can anyone give me a hint what should I do to resolve this problem? > > Tomasz Lewandowski > -- > View this message in context: http://n2.nabble.com/Netty-problem-with-large... > Sent from the Netty User Group mailing list archive at Nabble.com. > _______________________________________________ > netty-users mailing list > > https://lists.jboss.org/mailman/listinfo/nett... >
Trustin Lee (이희승) 1256637445Tue, 27 Oct 2009 09:57:25 +0000 (UTC)
I agree with David that this might be the limitation of O/S or the
server might have run out of ports.

Please make sure there are not many TIME_WAIT states.

BTW, in Linux, the hard limit of the backlog value is much less than 1000 IIRC.

HTH

— Trustin Lee, http://gleamynode.net/
On Mon, Oct 26, 2009 at 9:45 PM, AD wrote: > Hi, > > Could it be due to an OS limitation in the number of open connections? > Which OS do you use? > > David André > > On Mon, Oct 19, 2009 at 12:52, Tomasz Lewandowski > wrote: >> >> Hello, >> >> I have a simple HTTP Server implemented with Netty. >> >> I also have a stress test client (also written with Netty), which tries to >> start 10'000 long living connections for receiving Comet-like notifications >> (chunks of HTML in the form: "<script>....</script>", server writes about 50 >> chunks per second, so each simulated users gets a notification ones per 200 >> seconds). >> >> The client also generates aproximately 400 HTTP requests/connections (apart >> from 10'000 long living connections) per second. >> >> Everything is fine when I run 1 instance of the stress client. But when I >> try to run 2 instances on 2 different client machines (which would give me >> total of 20'000 Comet-like connections), after about 18'000 connections >> estabilished, I'm starting to get: >> >> java.net.ConnectException: connection timed out >> at >> org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processConnectTimeout(NioClientSocketPipelineSink.java:361) >> at >> org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:273) >> at >> org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) >> at >> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) >> at java.lang.Thread.run(Thread.java:619) >> >> My server works on >> Intel(R) Core(TM)2 Duo CPU E4500 @ 2.20GHz >> machine with 2GB RAM which is located in the same LAN as stress clients. >> >> My server bootstrap code looks like this: >> ServerBootstrap bootstrap = new ServerBootstrap( >> new NioServerSocketChannelFactory(Executors >> .newCachedThreadPool(), Executors >> .newCachedThreadPool())); >> >> I tried this on the server side: >> bootstrap.setOption("backlog", 1000); >> but it didn't help. >> >> Can anyone give me a hint what should I do to resolve this problem? >> >> Tomasz Lewandowski >> -- >> View this message in context: http://n2.nabble.com/Netty-problem-with-large... >> Sent from the Netty User Group mailing list archive at Nabble.com. >> _______________________________________________ >> netty-users mailing list >> >> https://lists.jboss.org/mailman/listinfo/nett... >> > > _______________________________________________ > netty-users mailing list > > https://lists.jboss.org/mailman/listinfo/nett... >
Home | About | Privacy