[asterisk-dev] RTP Bridging optimization

Kevin P. Fleming kpfleming at digium.com
Mon May 14 17:38:09 MST 2007


Vadim Lebedev wrote:

> Now, when we agree that it IS possible  to use single pipe for multiple
> bridges
> let's look on benefits:

I did not agree that it was possible, I told you it seemed possible but
would likely provide little or no benefit.

> As for now Asterisk when packet arrives on a briged socket
>     1. Thread switch to the reader thread
>     2. read from socket + transfer of data from kernel to user
>     3. thread swicth to writer thread
>     4. write to socket +  transfer of data from user to kernel

Where are these two threads you are referring to? Asterisk call bridges
happen in one thread per bridge.

> Now if my proposal is implemented in the worst case we will economise 2
> thread switches, 2 user/kernel data transfers
> plus we'll have much less threads in the system.
> 
> I think we can expect pretty dramatic improvements

This would only be true if your assumption about two threads per bridge
were true, but it is not. The only possible benefit of your proposal
would be the reduced kernel/user copying, but you've replaced it with
complex pipe setup and constant creation and destruction of splice()
structures in the kernel.

So far you haven't demonstrated any possible significant benefit from
this idea, so unless you can show us a working example where your idea
produces a performance improvement in any noticeable way, I don't think
you will accomplish much pursuing this theory.


More information about the asterisk-dev mailing list