Is there any possibility (or plans) to run Stream server in multiple isolates?

34 views
Skip to first unread message

Iván Zaera Avellón

unread,
May 14, 2013, 4:34:11 AM5/14/13
to rik...@googlegroups.com
I'm wondering if Rikulo Stream supports (or will) having many isolates for attending requests. I believe in multicore architecture you need at least one thread per processor which, if I'm not wrong, can only be achieved using multiple isolates in Dart.

Any hints? Or am I totally wrong about this?

Regards,
Ivan

Tom Yeh

unread,
May 14, 2013, 5:09:51 AM5/14/13
to rik...@googlegroups.com
Technically, Rikulo, as asynchronous event-driven architecture, achieves the high performance by executing non-blocking I/O in parallel with Dart code just like what node.js does. You might refer to here and here.

From our early evaluation, it scales well on a dual-core machine. If there are more computing power (such as 4 cpu and each 8 cores) or there are more computing task than database I/O, you can scale it by forking two or more processes (in OS) and having nginx as the front server. IMO, it is neater (and shall be faster) than using isolates in one process.

Iván Zaera Avellón

unread,
May 14, 2013, 5:26:42 AM5/14/13
to Tom Yeh, rik...@googlegroups.com
Good to know you have tested how it scales. I have plans to try to deploy something in heroku and that makes me feel more confident in that it will work :-).

For some reason I forgot to specify the other option (using a balancer and several processes) in the post. I agree with you that it is cleaner and much simpler than spawning isolates.


And just to learn more about it: how is it possible that it scales with two cores? If I understand, one Dart isolate uses just one thread and cannot run more than one event in the loop at the same time. So, even if you have async code you couldn't use more than one core (50% CPU in a dual core machine). What am I missing here?




2013/5/14 Tom Yeh <tom....@gmail.com>

Tom Yeh

unread,
May 14, 2013, 6:56:23 AM5/14/13
to rik...@googlegroups.com, Tom Yeh
The IO part started by the Dart code is actually handled by another thread/process. For example, it could be a database driver (written in C, running in a different thread or process), or an OS operation (reading a file in parallel).

Iván Zaera Avellón

unread,
May 14, 2013, 8:20:16 AM5/14/13
to Tom Yeh, rikulo
Now I see. 

Thanks :-)


2013/5/14 Tom Yeh <tom....@gmail.com>
Reply all
Reply to author
Forward
0 new messages