[OpenSIPS-Devel] RFC: new opensips design
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Fri Nov 7 16:46:17 CET 2008
Hi Iñaki,
The whole idea is to concentrate all waits in a single point (like you
do with a select while waiting for multiple TCP connections) - it is not
a serial wait that may lead to idle time (because of the serialization),
but a parallel approach where you are waiting in the same time for the
termination of any I/O (reading a message from the net, a finished DNS,
a DB response).
Just to give an example: let's assume we have 1 process
1) current design:
time T - a message is read from network
t+1 - a DB is invoked
---- idle ------
t+3 - reply from DB
t+4 - done with the message
t+5 - read the next one
2) new design
time T - a message is read from network (reactor gets indication
from the network socket)
t+1 - a DB is invoked (context is suspended and a new socket is
added to the reactor for waiting the DB reply)
t+2 - a second message is read from network (reactor gets again
indication from the network socket)
t+3 - second message is done
t+4 - reply from DB (reactor get indication from the DB socket) -
context is restored for the first message
t+5 - done with the first message
So, i the same amount of time, you use all the time for computing
instead of idle I/O and you can process more traffic.
Regards,
Bogdan
Iñaki Baz Castillo wrote:
> 2008/11/7 Bogdan-Andrei Iancu <bogdan at voice-system.ro>:
>
>> Why? - I made a summary here -
>> http://www.opensips.org/pmwiki.php?n=Development.NewDesign#toc1
>>
>
> Hi, I read:
>
> ----------
> 2.4 Asynchronous processing
> * entire processing in core must be based on a asynchronous
> reactor - there will
> be dead-time/idle because of I/O ops. The processing capacity
> will dramatically
> increase.
> ----------
>
> AFAIK Reactor Pattern also waits in I/O opperations. I've read about
> Proactor Pattern that doesn't wait for them:
> http://www.cs.wustl.edu/~schmidt/PDF/reactor-siemens.pdf
> http://www.cs.wustl.edu/~schmidt/PDF/proactor.pdf
>
> Well, I have no idea about both of them XD
>
>
More information about the Devel
mailing list