Some more insights :

- the send and receive buffer size should be set to : RTT * bandwidth, where
RTT is the round trip time for your network. If you have a 10Mbs bandwidth,
and if your latency when doing a ping to your server is 80ms, then the
buffer size should be 0,08 * 10 000 000 / 8 = 100Kb (source :
http://onlamp.com/pub/a/onlamp/2005/11/17/tcp_tuning.html).

Having a default value set to 1kb is a non sense here. However, this default
value is difficult to set if we haven't established a connection yet, so
maybe the best is to avoid establishing one and let the default system value
be selected.

I will have a look at the current code and see how this can work this way.

On Tue, Jun 22, 2010 at 1:35 PM, Alexander Christian <[email protected]> wrote:

>
> Um Ihre Privatsphäre zur schützen, wurden externe Bilder blockiert. Bilder
> anzeigen
>
> (Hopefully) Just a last remark:
>
> removing the line that sets the receive buffer size as shown below does
> fix the issue, but will leave other questions/problems open:
>
> 1) acceptor.getSessionConfig().getReadBufferSize() always refelcts the
> member variable of the session config, and not the socket setting.
> 2) setting a new receive buffer size always sets the member variable of
> session config. Only at the time the "open()" method in NioSocketAcceptor
> is called the value from session config is passed to the socket
> 3) with the current approach, it's not possible to change the read buffer
> size after the socket was bound. I'm not really sure if this is in general
> technically possible. But I can image at least one usecase where this
> could
> be an good idea
>
> br,
> Alex
>
>
> P.S. @Emmanuel
> If I want to reply to a mina-mailinglist-message that oyu have sent, I
> always need to re-set the "to:" field to the mina mailing list. There's
> somehow by default you address in "to:" and the mina address in "cc:". So I
> either need to "reply to all" or to "reply" and change the "to:" address to
> mina list address. Why is that? Other's don't have this effect ...
>
>
> On Tue, 22 Jun 2010 13:09:40 +0200, Emmanuel Lecharny
> <[email protected]> wrote:
> > Regarding the comment, and the default value override :
> >
> > - I have no idea why this comment has been added.
> > - it makes no sense to override the default system value, IMO.
> >
> > The second point can be fixed as soon as I get back my computer frome
> > Apple,
> > in the next couple of days (hopefully ...)
> >
> > On Tue, Jun 22, 2010 at 11:46 AM, Alexander Christian <[email protected]>
> > wrote:
> >
> >>
> >> On Tue, 22 Jun 2010 11:36:07 +0200, Alexander Christian <[email protected]>
> >> wrote:
> >> >
> >> > ----
> >> > try {
> >> >             // This is a non blocking socket channel
> >> >             channel.configureBlocking(false);
> >> >
> >> >             // Configure the server socket,
> >> >             ServerSocket socket = channel.socket();
> >> >
> >> >             // Set the reuseAddress flag accordingly with the setting
> >> >             socket.setReuseAddress(isReuseAddress());
> >> >
> >> >             // XXX: Do we need to provide this property? (I think we
> >> need
> >> > to remove it.)
> >> >
> >> >
> socket.setReceiveBufferSize(getSessionConfig().getReceiveBufferSize());
> >> >
> >> >             // and bind.
> >> >             socket.bind(localAddress, getBacklog());
> >> >
> >> >             // Register the channel within the selector for ACCEPT
> >> >             event
> >> >             channel.register(selector, SelectionKey.OP_ACCEPT);
> >> >             success = true;
> >> >         }
> >> > ----
> >> >
> >> > The comment already has some doubt if this is correct or not. I'm
> >> > currently analyzing what would be the default value before setting
> the
> >> mina
> >> > default...
> >> >
> >>
> >> I figured it out by running the following test class:
> >>
> >> ---
> >> import java.io.IOException;
> >> import java.net.ServerSocket;
> >> import java.nio.channels.ServerSocketChannel;
> >>
> >> public class Test {
> >>
> >>    public static void main(String[] args) throws IOException {
> >>        ServerSocketChannel channel = ServerSocketChannel.open();
> >>        channel.configureBlocking(false);
> >>        ServerSocket socket = channel.socket();
> >>        System.out.println(socket.getReceiveBufferSize());
> >>    }
> >>
> >> }
> >> ---
> >>
> >> The output on my Win7 64 bit + Sun JDK 6 Update 10 32bit is:
> >> 8192
> >>
> >> So the system would start with sufficient buffer size of 8192, but MINA
> >> reset's it to MINAs default, which is 1024.
> >> I think it does not make sense to overwrite by default the systems
> >> default
> >> values with own values, that in turn might cause problems.
> >> Wouldn't it be better if MINA starts with system defaults (provided by
> >> OS?) and if the user asks for the current set buffer sizes, the socket
> is
> >> asked for the current sizes?
> >>
> >> br,
> >> Alex
> >>
> >>
>



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

Reply via email to