You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by mat <fo...@gmail.com> on 2007/07/28 04:33:11 UTC

How to send and receive packet more efficient

I read this article this morning and I think it is interesting.
http://www-128.ibm.com/developerworks/linux/library/l-hisock.html?ca=dgr-lnxw01BoostSocket

The author points out 4 tips which can improve socket performace.

1)Minimize packet transmit latency. (Disabling the Nagle algorithm, just
like mina suggest)
2)Minimize system call overhead. (Reducing read and write)
Question: How mina manage this? IoSession.write() causes system write for
instance?
3)Adjust TCP windows for the Bandwidth Delay Product. (Define socket send
and receive buffer sizes.)
Question: How do I know which value to set?
4)Dynamically tune the GNU/Linux TCP/IP stack.
Linux OS related.

Re: How to send and receive packet more efficient

Posted by Trustin Lee <tr...@gmail.com>.
On 7/28/07, mat <fo...@gmail.com> wrote:
> I read this article this morning and I think it is interesting.
> http://www-128.ibm.com/developerworks/linux/library/l-hisock.html?ca=dgr-lnxw01BoostSocket
>
> The author points out 4 tips which can improve socket performace.
>
> 1)Minimize packet transmit latency. (Disabling the Nagle algorithm, just
> like mina suggest)
> 2)Minimize system call overhead. (Reducing read and write)
> Question: How mina manage this? IoSession.write() causes system write for
> instance?

MINA doesn't manage it.  IoSession.write() usually causes one system call.

> 3)Adjust TCP windows for the Bandwidth Delay Product. (Define socket send
> and receive buffer sizes.)
> Question: How do I know which value to set?

Start from the buffer size calculation equation in 'Tip #3' of the
article.  However, you need to run performance tests to get the
optimal value anyways.

> 4)Dynamically tune the GNU/Linux TCP/IP stack.
> Linux OS related.

Yes, it differs between diferent operating systems, so you'll have to
refer to the manual if you want to tune at such level.  I think it's
just enough to adjust buffer sizes though.

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6