On Fri, May 24, 2013 at 7:36 AM, Baz <[email protected]> wrote: > I'm new to node and I am investigating using node for a non-web > always-blocking cpu-intensive high-memory process. The process basically > runs in an infinitely loop, loading a lot of data from a datastore into > memory, applying complex (blocking) business logic, then saving the result > back to the store, and starting over again. It doesn't respond to > web-requests or process html or anything of that nature. It just needs to > run this loop. > > Is this an acceptable use-case for node, given that it breaks every > rule-of-thumb ever written?
It's certainly possible but it's not node's primary strength. > Is node reasonably efficient at doing this (it doesn't have to be the best > solution in the world, just good enough)? It depends on what your business logic consists of. For example, numbers in JS are 64 bits doubles so you're dealing with inexact floating-point arithmetic all the time. Which is okay for most use cases but not, say, when you are processing monetary transactions. > Are there pitfalls to consider with having an always blocked event loop? Things like process.nextTick() and setTimeout() won't work. Neither will any kind of asynchronous I/O but I guess you already realized that. > Are there any issues with using lots of ram on a server (30gb+) in a single > node? Not really. However, the JS heap is limited to slightly less than 2 GB. Buffers and typed arrays live mostly outside the JS heap though, so it's still possible to process large quantities of data. -- -- 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
