<div>We are using it (udp) to burst a search request to hundreds or thousands of machines. Sending using TCP degrades as more machines are added to the network - even when using our custom connection pooling we still see degradation - using udp provides much better performance (and we cannot use multicast). Our message size is a maximum of 5K, - btw - we use netty tcp elsewhere when reliablity is required. </div>
<div>Cheers Neil.<br><br></div>
<div class="gmail_quote">2009/6/26 "ÀÌÈñ½Â (Trustin Lee)" <span dir="ltr"><<a href="mailto:trustin@gmail.com">trustin@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">By the way, please let me know if you think the default (768) is not sane and should be increased. I'm not really a UDP expert so other people's suggestion is appreciated.<br>
<br>Thanks<br><br>ÀÌÈñ½Â (Trustin Lee) wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi Neil,<br><br>It's because the default receiveBufferSizePredictor of DatagramChannel<br>is FixedReceiveBufferSizePredictor(768). You can configure the channel<br>
to a FixedReceiveBufferSizePredictor with different payload size. For<br>example:<br><br> DatagramChannel ch = ...;<br> ch.getConfig().setReceiveBufferSizePredictor(<br> new FixedReceiveBufferSizePredictor(1024));<br>
<br>or:<br><br> ConnectionlessBootstrap b = ...;<br> b.setOption("receiveBufferSizePredictor",<br> new FixedReceiveBufferSizePredictor(1024));<br><br>BTW, I wouldn't recommend to using AdaptiveReceiveBufferSizePrediector<br>
for datagrams.<br><br>HTH,<br>Trustin<br><br>On 2009-06-25 ¿ÀÀü 4:49, neilson9 wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi,<br><br>Im having a couple of problems sending UDP byte[]> 768K<br><br>For example if Im passing 1024bytes the buffer.readIndex does not get<br>
updated. The sender only passes 768 bytes and if I manually set the<br>readIndex to 768 it sends another 768 bytes on the second send. I would like<br>to iterate of the byte[] and use the offsets to prevent copying data etc.<br>
<br>Any help appreciated.<br>Regards Neil.<br><br>For example:<br> byte[] payload = userdata....;<br><br> channel = (DatagramChannel) b.bind(new InetSocketAddress(0));<br> ChannelBuffer buffer = dynamicBuffer(bytes.length);<br>
buffer.writeBytes(bytes);<br> LOGGER.info("Sending:" + bytes.length + " sent:" + buffer.readerIndex());<br> ChannelFuture channelFuture = channel.write(buffer, new<br>
InetSocketAddress(uri.getHost(), port));<br> // manually setting to see if it sends the remainder<br> buffer.readerIndex(768);<br> <br> channelFuture = channel.write(buffer, new<br>
InetSocketAddress(uri.getHost(), port));<br> LOGGER.info("Sending:" + buffer.readerIndex());<br><br><br></blockquote><br><br><br>------------------------------------------------------------------------<br>
<br>_______________________________________________<br>netty-users mailing list<br><a href="mailto:netty-users@lists.jboss.org" target="_blank">netty-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
</blockquote><br><br>-- <br>Trustin Lee, <a href="http://gleamynode.net/" target="_blank">http://gleamynode.net</a><br><br>_______________________________________________<br>netty-users mailing list<br><a href="mailto:netty-users@lists.jboss.org" target="_blank">netty-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br></blockquote></div><br>