Hi Stefan, I'm only for an asynchronous approach - synchronous is not able to handle large traffic and to scale (even in a one thread per message approach).
So, the only option is async MT, even if it is much, much difficult to implement. And I have to admit that (if you disregard the number of available core) I also found very, very attractive the idea of a single async process handling the whole traffic - as the complexity will be done with 80%.....:D It will be interesting what will be the real boost between a single process approach (can use only one core) and a multi-proccess approach (with inter process sync, locking, data exchange, but with multiple cores).... Regards, Bogdan 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. > > nowadays, thread creation has become so cheap (in comparision...), > that synchronous MT (create one thread per task) is definitely an > option I would say. > > but still async MT is better, because you save just this thread > createion cost, and by this you are safe against certain (blocking) > DOS attacks. but it comes at the price of higher implementaion > complexity. its a pity one probably has to make use of all cores, > otherwise completely async processing with only _one_ thread would > make the simplest design, and context isolation unnecessary (thus > inter-message/inter-transaction/inter-dialog/... processing would > become simple to implement) - and then python would be a possible > candidate. > > Stefan > > o Bogdan-Andrei Iancu [11/07/08 17:32]: >> And one more thing - of course you process more. Note that not all >> the traffic will require much I/o interaction (rather then reading >> and putting back on the network) - it is 100% CPU using traffic (like >> sequential request - ACK for examples). Such traffic will perfectly >> use the idle time from messages that are stuck in I/O (DNS, DB). >> >> Regards, >> Bogdan >> >> Bogdan-Andrei Iancu wrote: >>> Hi Stefan, >>> >>> You do not create additional threads or processes - you just use the >>> time you waist right now in synchronous I/O ops for processing other >>> messages by doing context switching. >>> >>> So DOS attack is not possible - at least not on this scenario :) >>> >>> Regards, >>> Bogdan >>> >>> Stefan Sayer wrote: >>> >>>> o Bogdan-Andrei Iancu [11/07/08 16:46]: >>>> >>>>> 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. >>>>> >>>> i doubt you can process more traffic - but you can use all your >>>> threads/processes efficiently, and do neither have to create too >>>> many threads, not have all threads blocked, e.g. on some DOS attacks. >>>> >>>> Stefan >>>> >>>> >>> >>> >>> _______________________________________________ >>> Devel mailing list >>> Devel@lists.opensips.org >>> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel >>> >>> >> > _______________________________________________ Devel mailing list Devel@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/devel