[asterisk-dev] Asterisk scalability

Benny Amorsen benny+usenet at amorsen.dk
Mon Feb 16 04:05:58 CST 2009


Johansson Olle E <oej at edvina.net> writes:

> Now, can anyone start a discussion on the way we handle threads? If we  
> run on a quad-core or a system with dual quad core CPUs, we have  
> capactiy for an enormous quantity of calls, with at least one thread  
> per call. Can a modern Linux/Unix thread scheduler handle 10 000  
> threads efficently?

The scheduler shouldn't be a problem (the kernel list will think
you're crazy though). However, it isn't just the scheduler that is the
problem. Performance will depend a lot on what those threads are
doing. It will be very hard to avoid cache misses with 10000 threads
running, unless they are all running approximately the same code at
the same time.

Traditionally, the way to get high performance has been to have a set
of worker threads and then a central loop which passes jobs to those
threads. The number of threads would then be equal to the number of
CPU's plus the number of outstanding I/O requests. You could in theory
avoid the I/O threads by doing async I/O, but Linux async I/O isn't
all that mature.


/Benny




More information about the asterisk-dev mailing list