understanding threads relative to OPEN/BOUND/CONNECTED ... etc
anthony_w
awwold69 at hotmail.com
Mon May 24 16:43:53 EDT 2010
Hi,
I'm trying to get a handle on understanding how to gauge the peformance,
throughput, and excessive threading. My client app sends a message to the
server. The server responds with multiple replies, and on the last reply,
closes the channel. The client then exits gracefully (as far as I can
tell).
So I see this in my log. What does "thread-#" mean? The number increases
with each successive client instance that I run. Am I somehow not cleaning
up properly, or maybe using the wrong thread pool? I want to make sure I'm
leaving idle threads around.
INFO [pool-3-thread-1] ............... 127.0.0.1:6789] OPEN
INFO [pool-3-thread-2] ............... 127.0.0.1:6789] BOUND:
/127.0.0.1:6789
INFO [pool-3-thread-3] ............... 127.0.0.1:6789] CONNECTED:
/127.0.0.1:3249
INFO [pool-3-thread-4] ............... 127.0.0.1:6789] INTEREST_CHANGED
INFO [pool-3-thread-6] ............... 127.0.0.1:6789] INTEREST_CHANGED
INFO [pool-3-thread-30] .............. 127.0.0.1:6789] DISCONNECTED
INFO [pool-3-thread-31] .............. 127.0.0.1:6789] UNBOUND
INFO [pool-3-thread-32] .............. 127.0.0.1:6789] CLOSED
Here is my setup:
bootstrap = new ServerBootstrap(
new NioServerSocketChannelFactory(
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool()));
ExecutionHandler executionHandler = new ExecutionHandler(new
MemoryAwareThreadPoolExecutor(700, 50, 50));
bootstrap.setPipelineFactory(new
ServerPipelineFactory(executionHandler));
Here is my pipeline factory. I omitted the constructor but you can see in
the line above that it takes in the execution handler:
p.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(1048576,
0, 4, 0, 4));
p.addLast("protobufDecoder", new
ProtobufDecoder(PRequestProtocol.Request.getDefaultInstance()));
p.addLast("frameEncoder", new LengthFieldPrepender(4));
p.addLast("protobufEncoder", new ProtobufEncoder());
p.addLast("executor", this.executionHandler);
p.addLast("handler", new ServerHandler());
Thanks.
Tony.
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/understanding-threads-relative-to-OPEN-BOUND-CONNECTED-etc-tp5095700p5095700.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list