On 22 jun, 19:58, Mark Hahn <m...@hahnca.com> wrote:
> Node sounds like a fit to me.
>
> Why do you have workers?  Doesn't rails automatically use threads/processes
> to allow multiple things to happen at once?  (I know nothing about how a
> rails server works).
>

On the contrary, Ryan used rails as an example of way node should
exists, rails is single threaded. The why to rails can only answer one
request at a time. The way rails is scaled is by starting/forking more
servers, if your app uses 40MB in memory, and you can answer a request
every 200ms you can handle 5 clients per second, so if you want
responses you need more rails servers running(forked) 30 instances
will answer to 150 concurrent request per second but will use 1.2 GB
of ram. Also scaling with rails involve caching parts of the serve
html so the app gets out of the way and lets the native servers
(apache which is threaded or ngingx which is evented) handle serving
the cached asset or peace of html.

Any interaction with anything that can block (talking to an external
service) will block that instance for all clients so if a client if
sending several emails in one request, other clients cant be served by
rails until the process ends. That is way background processes are
used, you put the data in a queue(redis for example) for inter process
communication and you have another instance of rails which usually
doesnt do anything but process the background jobs pick up the data
and do the jobs, that instance if usually performing a time based loop
waiting for anything to appear in the queue.

So trying to integrate rails with for example, an external web service
or evented telephony is a REAL PAIN.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to