Re: [akka-user] Is it possible to set UDP buffer receive size with Akka I/O 2.2-M3?

147 views
Skip to first unread message

Roland Kuhn

unread,
Apr 23, 2013, 5:37:45 PM4/23/13
to akka...@googlegroups.com
Hi Guillaume,

you can set all options exposed by NIO. You can do that within the Bind (inbound) or Connect (outbound) message, e.g.

IO(Tcp) ! Connect(remoteAddress, None, List(Tcp.SO.ReceiveBufferSize(1024 * 1024 * 20)))

However, you will have to use Linux (if I’m not mistaken) for this to be successful, and you will have to tune some kernel parameters to allocate such a HUGE buffer. Keep in mind that this buffer will be allocated using non-pageable memory for every socket you create like this.

Regards,

Roland

22 apr 2013 kl. 16:48 skrev Guillaume Belrose:

Hi all, 

As part of a product, I am building a video processing application based on Akka actors. Bu the way, we really like Akka so far, it is a nice piece of engineering.

The piece I am working on right now is a RTP / MPEG transport stream de-multiplexer. I am basically receiving RTP packets via UDP and processing them to extract meaningful information.

I've written a simple UDP receiver using Akka and the IO features in 2.2-M3. I've noticed that when the file that I am streaming is high bitrate (something like AVC Intra which is over 15Mb/s), the UDP receiver starts dropping packets.

I have a working version of the UDP receiver based on plain vanilla datagram sockets, and using plain vanilla networking, it is possible to augment the size of the receive buffer, and this makes the problem go away. You do something like: 

  val channel = DatagramChannel.open();
  val buffer = ByteBuffer.allocate(2048);
  val socket = channel.socket
  socket.setReceiveBufferSize(1024 * 1024 * 20) 

However, I prefer the Akka IO abstraction a lot more, and I was wondering if there is a way to programatically set the buffer receive size.

Thanks in advance,

Guillaume.


--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



Dr. Roland Kuhn
Akka Tech Lead
Typesafe – Empowering professional developers to build amazing apps.
twitter: @rolandkuhn

√iktor Ҡlang

unread,
Apr 24, 2013, 11:21:55 AM4/24/13
to Akka User List
Cool, keep us posted!


On Wed, Apr 24, 2013 at 8:09 AM, Guillaume Belrose <kaf...@gmail.com> wrote:
Thanks Roland, 
I will try what you suggest for UDP. The system does not have to scale to a large number of sockets, but each one has to be able to support high throughput (where high ~= 40 MB/s)



--
Viktor Klang
Director of Engineering

Twitter: @viktorklang
Reply all
Reply to author
Forward
0 new messages