<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18241"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=4 face=Batang><SPAN
class=448304713-20022009>Ian,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=4 face=Batang><SPAN
class=448304713-20022009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=4 face=Batang><SPAN
class=448304713-20022009>Did you make any modifications in the kernel to achieve
IMpps per interface ?</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=4 face=Batang><SPAN
class=448304713-20022009>I will appreciate any pointers.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=4 face=Batang><SPAN
class=448304713-20022009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=4 face=Batang><SPAN
class=448304713-20022009>Best regards,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=4 face=Batang><SPAN
class=448304713-20022009>Abdul Hakeem</SPAN></FONT></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
Ian FREISLICH <<A href="mailto:ianf@clue.co.za">ianf@clue.co.za</A>>
writes:<BR><BR>> 80kpps is not that much. I have machines capable of
handling just<BR>> shy of 1Mpps on 1 physical interface, the main problem is
the<BR>> physical medium. My measured max rate on 100M ethernet is
148kpps<BR>> using UDP with a payload of 1 byte. You should be able to
get that<BR>> packet rate in on gigE with a real-world payload.<BR><BR></DIV>
<DIV class=gmail_quote>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>The challenge is that the 80kpps have to go all the way to
user space<BR>and back out to a different ethernet interface. The packets are
spread<BR>across 1600 streams, making for lousy cache behaviour when
threaded,<BR>and timing is worst-case (each stream gets a packet every
20ms).<BR></BLOCKQUOTE></DIV><BR>
<DIV><SPAN style="COLOR: rgb(136,136,136)"
class=Apple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)" class=Apple-style-span>So that
suggests an optimisation in the path from kernel to user space and back again -
which is some sort of super-recvfrom which can collect ALL the received data
across all the RTP sockets in one big read. The kernel can queue all the
data into a buffer as it arrives and that data can all be passed to Asterisk in
one go.</SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)"
class=Apple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)" class=Apple-style-span>Perhaps on the
Asterisk side a pool of RTP-router-threads can each use a system call like this
to read data from a few hundred sockets, then process all those received RTP
packets into corresponding output buffer which then passed back to the kernel
via super-send.</SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)"
class=Apple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)" class=Apple-style-span>Add in any
necessary processing for dsp etc and Bob's your uncle.</SPAN></DIV>
<DIV><BR></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)" class=Apple-style-span>You'd use a
pool of threads so that you had at least one RTP-router-thread for each
CPU.</SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)"
class=Apple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)" class=Apple-style-span>You'd end up
essentially doing 50 system calls per sec per CPU to get all the data from the
kernel into Asterisk and 50 to write the outgoing data.</SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)"
class=Apple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)" class=Apple-style-span>Obviously
there is lots of hand-waving here, and I've probably reinvented something
that is already available in the kernel - in which case someone please enlighten
me.</SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)"
class=Apple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)" class=Apple-style-span>For IAX it all
arrives on one socket anyway - so its just a matter of being able to get it all
out of the kernel in one big read.</SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)"
class=Apple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)" class=Apple-style-span>We're still
going to and from userspace all the time, as opposed to efforts to do the whole
job in the kernel, but I'm sure there is performance to be gained here, without
losing the flexibility that Asterisk's multi-protocol architecture
brings.</SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)"
class=Apple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)" class=Apple-style-span>And /me waves
at Ian.</SPAN><BR></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)"
class=Apple-style-span><BR></SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)"
class=Apple-style-span>Regards,</SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)" class=Apple-style-span>Steve
Davies</SPAN></DIV>
<DIV><SPAN style="COLOR: rgb(136,136,136)"
class=Apple-style-span><BR></SPAN></DIV></BODY></HTML>