I currently create an application, which needs to run millions of statistical regressions in a short time. Parallelization of these calculations is one possibility to accelerate the process.
The OpenCPU
server doesn’t seem to scale well with parallel executed commands. All commands are executed in a sequential manner.
Is it possible to spawn multiple R
sessions using OpenCPU or do I need to run multiple instances of the server? Do I miss something here on how OpenCPU
can process multiple computationally expensive commands simultaneously?
The OpenCPU cloud server executes all http requests in parallel, so first observation is false. Of course you must make simultaneous requests to do so.
If your code consists of a single R function or script, OpenCPU won't magically parallelize things for you, if that is what you are after. In that case you would need to use something like snow or mcparallel in your R function. But that is unrelated to OpenCPU, which only provides an http interface to your R function or script.