You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Colin Koeck <cl...@arctosllc.com> on 2007/07/01 23:25:49 UTC

40 ms intermittent latency - large volume, small messages

Hi, I've been experiencing intermittent latency with mina, generally causing 37-40 millisecond delays.
 
This occurs when I said large amounts of small messages (usually in 5 - 20 count bursts, each message no more than 500 bytes) across a 100Mbit ethernet network.  I'm using Linux running on dual-core 2.2 GHz AMD Opteron machines.
 
I've found users having similiar problems with other software (39 ms delays), in this case ActiveMQ
http://www.nabble.com/High-latency-for-small-messages-problem-t3159901.html, which leads me to believe this is not directly related to mina.
 
I have mina setup with SimpleByteBuffer allocating non-direct memory.  I'm pretty sure this isn't a  direct problem with mina, but I'm curious if anyone has experienced this problem with mina, and if there is anyway to resolve this issue.  I would appreciate any help, thanks!
 
- Colin Koeck
<ma...@arctosllc.com>  

RE: 40 ms intermittent latency - large volume, small messages

Posted by Colin Koeck <cl...@arctosllc.com>.
Yes, I tried disabling nagle's algorithm about a week ago, I haven't checked the log files yet for latency but I will do so shortly.  Thanks to everyone for the tips!
 
Regards,
 
Colin

________________________________

From: peter royal [mailto:proyal@fnokd.com]
Sent: Sun 7/1/2007 6:39 PM
To: dev@mina.apache.org
Subject: Re: 40 ms intermittent latency - large volume, small messages



have you tried toggling tcp_nodelay?
-pete

-- 
peter royal - (on the go)


On Jul 1, 2007, at 2:25 PM, "Colin Koeck" <cl...@arctosllc.com> wrote:

> Hi, I've been experiencing intermittent latency with mina, generally 
> causing 37-40 millisecond delays.
>
> This occurs when I said large amounts of small messages (usually in 
> 5 - 20 count bursts, each message no more than 500 bytes) across a 
> 100Mbit ethernet network.  I'm using Linux running on dual-core 2.2 
> GHz AMD Opteron machines.
>
> I've found users having similiar problems with other software (39 ms 
> delays), in this case ActiveMQ
> http://www.nabble.com/High-latency-for-small-messages-problem-t3159901.html
> , which leads me to believe this is not directly related to mina.
>
> I have mina setup with SimpleByteBuffer allocating non-direct 
> memory.  I'm pretty sure this isn't a  direct problem with mina, but 
> I'm curious if anyone has experienced this problem with mina, and if 
> there is anyway to resolve this issue.  I would appreciate any help, 
> thanks!
>
> - Colin Koeck
> <ma...@arctosllc.com>



RE: 40 ms intermittent latency - large volume, small messages

Posted by Dawie Malan <da...@mxit.com>.
If you are running on Linux and Sun's 1.5.0_10 or later VM, try adding the
following to your startup:

-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.EPollSelectorProvider

We've found that kernel polling greatly improves latency, especially when you
have a lot of socket connections (10,000+).

Dawie

-----Original Message-----
From: peter royal [mailto:proyal@fnokd.com] 
Sent: 02 July 2007 12:39 AM
To: dev@mina.apache.org
Subject: Re: 40 ms intermittent latency - large volume, small messages

have you tried toggling tcp_nodelay?
-pete

--  
peter royal - (on the go)


On Jul 1, 2007, at 2:25 PM, "Colin Koeck" <cl...@arctosllc.com> wrote:

> Hi, I've been experiencing intermittent latency with mina, generally  
> causing 37-40 millisecond delays.
>
> This occurs when I said large amounts of small messages (usually in  
> 5 - 20 count bursts, each message no more than 500 bytes) across a  
> 100Mbit ethernet network.  I'm using Linux running on dual-core 2.2  
> GHz AMD Opteron machines.
>
> I've found users having similiar problems with other software (39 ms  
> delays), in this case ActiveMQ
> http://www.nabble.com/High-latency-for-small-messages-problem-t3159901.html 
> , which leads me to believe this is not directly related to mina.
>
> I have mina setup with SimpleByteBuffer allocating non-direct  
> memory.  I'm pretty sure this isn't a  direct problem with mina, but  
> I'm curious if anyone has experienced this problem with mina, and if  
> there is anyway to resolve this issue.  I would appreciate any help,  
> thanks!
>
> - Colin Koeck
> <ma...@arctosllc.com>

*******************************************************************
Click here to view our e-mail legal notice:
http://www.mxit.co.za/pdfs/mxit_legal.pdf or call: +27 21 888 7000
*******************************************************************



Re: 40 ms intermittent latency - large volume, small messages

Posted by peter royal <pr...@fnokd.com>.
have you tried toggling tcp_nodelay?
-pete

--  
peter royal - (on the go)


On Jul 1, 2007, at 2:25 PM, "Colin Koeck" <cl...@arctosllc.com> wrote:

> Hi, I've been experiencing intermittent latency with mina, generally  
> causing 37-40 millisecond delays.
>
> This occurs when I said large amounts of small messages (usually in  
> 5 - 20 count bursts, each message no more than 500 bytes) across a  
> 100Mbit ethernet network.  I'm using Linux running on dual-core 2.2  
> GHz AMD Opteron machines.
>
> I've found users having similiar problems with other software (39 ms  
> delays), in this case ActiveMQ
> http://www.nabble.com/High-latency-for-small-messages-problem-t3159901.html 
> , which leads me to believe this is not directly related to mina.
>
> I have mina setup with SimpleByteBuffer allocating non-direct  
> memory.  I'm pretty sure this isn't a  direct problem with mina, but  
> I'm curious if anyone has experienced this problem with mina, and if  
> there is anyway to resolve this issue.  I would appreciate any help,  
> thanks!
>
> - Colin Koeck
> <ma...@arctosllc.com>

Re: 40 ms intermittent latency - large volume, small messages

Posted by Emmanuel Lecharny <el...@gmail.com>.
Hi Colin

if you are on Linux, you may want to disable the naggle algorithm :

((SocketSessionConfig)(acceptorCfg.getSessionConfig())).setTcpNoDelay( true );

I think it can change the performance *a lot* :)

(Naggle algorithm will wait 25 ms before sending a packet, in order to
send the less possible packets. But it kills performances when sending
a lot of small packets, instead of sending a small numbe rof big
packets)



On 7/1/07, Colin Koeck <cl...@arctosllc.com> wrote:
> Hi, I've been experiencing intermittent latency with mina, generally causing 37-40 millisecond delays.
>
> This occurs when I said large amounts of small messages (usually in 5 - 20 count bursts, each message no more than 500 bytes) across a 100Mbit ethernet network.  I'm using Linux running on dual-core 2.2 GHz AMD Opteron machines.
>
> I've found users having similiar problems with other software (39 ms delays), in this case ActiveMQ
> http://www.nabble.com/High-latency-for-small-messages-problem-t3159901.html, which leads me to believe this is not directly related to mina.
>
> I have mina setup with SimpleByteBuffer allocating non-direct memory.  I'm pretty sure this isn't a  direct problem with mina, but I'm curious if anyone has experienced this problem with mina, and if there is anyway to resolve this issue.  I would appreciate any help, thanks!
>
> - Colin Koeck
> <ma...@arctosllc.com>
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com