0
votes

Is there some issue with Netty handling read and write on the same Channel. We have a message broker built in Netty 4.1. We performed two types of tests for load testing.

1) Client A sends a PUBLISH packet to the broker. The broker does some processing and sends the packet back to the same client via the same channel through which it came.

2) The second scenario is where Client A sends a PUBLISH packet to the broker via its Channel. The broker performs some processing and then sends the packet randomly to any one of the clients connected to the broker at that time (except for the current client ofcourse).

We found that in the first case, the read operation for Netty takes a lot of time whereas in the second case everything runs very smoothly and we get the desired theoretical latency.

So just wanted to confirm as to how Netty handles read and write on the same channel.

1

1 Answers

1
votes

Read and write on the same channel is a very typical usage of Netty: for example, i think web server is almost doing the same thing. Web server/ proxy server in Netty's example codes could show how to do that and the performance should be ok.

I think the first step is to figure out where the "slow" is. If there is no slow in code, take a look at the tcp dump might help.