[asterisk-dev] Asterisk Performance as a B2BUA

Simon Perreault simon.perreault at viagenie.ca
Fri Nov 23 12:06:53 CST 2007


On Friday 23 November 2007 12:32:44 Dmitry Andrianov wrote:
> 1. some SIP messages may require Asterisk to do asynchronous database
> query (realtime)

I don't get your point. If the query is asynchronous, where is the problem? 
What does "realtime" mean?

> 2. locking: if during any operation SIP thread has to obtain lock held
> by another thread, waiting on that lock will definitely make CPU
> utilization less than 100%.

Again, where is the problem?

My point is: the SIP thread does *not* use 100% of its allocated time slices. 
Unless it does, there is no point in adding SIP threads.

> Another benefit in having multiple threads is reduced latency. If 10 SIP
> messages arrive to the asterisk server simultaneously and each message
> takes 10 ms to be handled, it means first response to the first message
> will be sent in 10 ms while last message will be replied only in 100 ms.
> On dual-core system, running two SIP threads, last message most likely
> won't take more than 50 ms.

What you're saying in effect is that the SIP thread uses 100% of its allocated 
time slices *for a very short period of time*, and therefore multiple threads 
are justified during that very short period of time. Well, this is true of 
any kind of processing but you need to keep Amdahl's law in mind. Optimizing 
for CPU while the process is clearly I/O bound is wrong. Also it doesn't 
justify adding all the complexity.



More information about the asterisk-dev mailing list