I am happy to announce the release of node-perfectapi version 1.0. This release improves stability, and improves scalability. For a brief intro to perfectapi, just follow the link.
I’ll talk about scalability a little bit because it is an important new feature. As you probably know, Node.js applications run by default in a single process. It is easy to use code to workaround this limitation (at least within a single machine), but it is up to the programmer to know how best to do that in a way that makes their code scale appropriately.
What I did for this release is simplify that decision a little bit for the developer, by automatically scaling the perfectapi code across multiple CPUs. This means that HTTP requests and responses are handled by separate processes than the developer’s code. Any errors in that code will be isolated, and any delays in that code will not affect the developers code.
For the developers, their own code can still make use of additional workers for CPU intensive tasks. There is an example in the source code that demonstrates how to do this, as well as some benchmarks that show expected gains when using additional workers.