Netty problem with large number of connections

Tomasz Lewandowski tomasz.lewandowski at poczta.onet.pl
Mon Oct 19 07:52:59 EDT 2009


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-number-of-connections-tp3848540p3848540.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list