Very long delay when sending a simple message

Christian Migowski chrismfwrd at gmail.com
Thu Jan 27 03:49:20 EST 2011


Hi Ilya,

this is strange and should not happen. Does this happen on all
requests or only sometimes?
Can you create a small test program which illustrates this behaviour?
What is suspicious is that you're using a different thread to send the
messages... could it be that you have a loop somewhere else in your
code which is eating up all of Netty IO Worker threads time?

regards,
christian!


On Thu, Jan 27, 2011 at 5:08 AM, jartur <jartur at l-square.net> wrote:
>
> Hello,
>
> I'm having a little trouble here which I cannot resolve and I do not
> understandd why it occurs and what to tune. I have a very simple Netty
> server which just serves Adobe Flash policy requests. It receives
> "<policy-file-request/>\0" and sends back a simple String with appropriate
> policy XML. I use DelimiterBasedFrameDecoder with null delimiter to split
> requests, StringDecoder to get a string and StringEncoder to send a
> response.
>
> I set tcpNoDelay to true for a connected channel. When I receive message in
> my main handler I do
>
> if (msg.equalsIgnoreCase(PolicyServer.POLICY_REQUEST))
> {
>  PolicyServer.ex.execute(new Runnable() {
>    public void run()
>    {
>      e.getChannel().write(PolicyServer.POLICY_XML +
> "\0").addListener(ChannelFutureListener.CLOSE);
>    }
>  });
> }
>
> I do writing in a separate thread pool because I had problems previously
> with writing from the same thread (everything just becomes slow to react).
> Now, with .addistener(ChannelFutureListener.CLOSE) everything works just
> fine, but when it wasn't there (which is the case  for my other, much more
> complex server where I keep long-running sessions) I noticed that client
> first received about 250 bytes and then only after about 9 seconds did it
> receive the rest of the message. I'm worried about this because in case of
> my other server this behaviour might lead to client not receiving full
> packet of data in time which is crucial because client must react to certain
> messages within rather short amount of time (say, couple of seconds). I
> tried to search the Internet for this but I really don't know how to make a
> correct search query or so it seems. Please, if you can tell me what I
> should do to avoid such stalls I would be very grateful.
>
> Thank you,
> Ilya
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Very-long-delay-when-sending-a-simple-message-tp5965153p5965153.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>



More information about the netty-users mailing list