[OpenSIPS-Devel] RFC: new opensips design

Stefan Sayer stefan.sayer at iptego.com
Sun Nov 9 11:23:48 CET 2008



o Dan Pascu [11/09/08 04:48]:
> On Friday 07 November 2008, Stefan Sayer wrote:
>> sure. but: given you have enough processes/threads, you can fill up
>> your CPU with synchronous (blocking) processing as well. only in the
>> case that you don't have enough children, you waste 'real' time while
>> waiting.
> 
> You seem to forget that lots of threads/processes incur a significant 
> penalty from context switching, reaching a point where you spend more 
> time with context switching than with the actual processing. How many 
> threads do you figure you will need to fill up the CPU and keep it busy? 
> Because I can easily generate a lot of initial INVITES that will block 
> their processing for 15 seconds waiting on DNS lookups from a hostile DNS 
> server that doesn't respond to any queries. If I generate only 1000 such 
> requests per second, which I can do with ease, you will need to create at 
> least 15000 threads to keep them busy all the time and avoid any I/O 
> wait. At that point (in fact much sooner than that), you will spend over 
> 80% of time with context switching between threads, thus your efficiency 
i doubt that. if these threads are in blocked waiting, they are sleeping 
and do not consume CPU for context switching, right? but: for 15k 
threads you will need a huge amount of memory for the stacks, which is 
pretty unneccesary.

> will be 1/5 of a proxy using an async design.
all in all i fully agree that async design is more appropriate, but one 
needs to be clear what it will solve and what not.

Stefan


> 

-- 
Stefan Sayer
VoIP Services

stefan.sayer at iptego.com
www.iptego.com

IPTEGO GmbH
Am Borsigturm 40
13507 Berlin
Germany

Amtsgericht Charlottenburg, HRB 101010
Geschaeftsfuehrer: Alexander Hoffmann



More information about the Devel mailing list