[OpenSIPS-Devel] RFC: new opensips design
Dan Pascu
dan at ag-projects.com
Sun Nov 9 04:48:33 CET 2008
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
will be 1/5 of a proxy using an async design.
--
Dan
More information about the Devel
mailing list