title: Who manages (creates, allocates memory, etc.) R sessions / R processes within OpenCPU?
body: <p>We have an OpenCPU cloud server, installed on a RedHat server with Apache 2.0 and rApache, which runs some quite memory- and processing-intensive calculations. Our app runs rather slowly (slower than on a less powerful laptop) - we think this is because of the memory allocation on the server.
  For this reason we parallelized the app for the server (using the <code>parallel</code> package), but even though normally one can run many (more than 20) parallel R jobs on the server, our app can only run around 18.</p>
  
  <p>In order to understand what is going on, my question is: when I call an R function through the OpenCPU web interface, which component of the server creates/spawns R processes and manages their memory allocation? Is it <code>r_mod</code> or the Apache server itself, through some other modules? Does the <code>Prefork</code> MPM have an effect on this (based on <a href="https://stackoverflow.com/questions/44688149/how-many-requests-can-be-processed-simultaneously-by-r-opencpu">this answer</a>)? Which part of this work is done by OpenCPU?</p>
  
  <p>I read the OpenCPU documentation, rApache documentation, all stackoverflow questions on OpenCPU, but I didn't manage to understand how R processes are managed in particular. Sorry if I missed something, I'd be really grateful if anybody could point me to the source of this information.</p>