rexyai / RestRserve

R web API framework for building high-performance microservices and app backends
https://restrserve.org
276 stars 32 forks source link

How to specify the amount of servers in parallell #178

Closed Andreas4242 closed 2 years ago

Andreas4242 commented 2 years ago

Hi

thank you so much for this package! I have the following question: Every time i start RestRserve i get the following printout:

-- running Rserve in this R session (pid=20580), 2 server(s) --

Is it possible to run more than 2 servers? Where can i specify the amount? Or does Rserve scale up automatically?

BR

artemklevtsov commented 2 years ago

Rserve forks main process when handle requests, From the docs:

Rserveuses fork to create a new, initialized process as soon as a new incoming connection arrives. For most current operating systems fork has little overhead, since the same memory is used for the code and data segment is copied on write only. This allows very fast spawning of Rprocesses for the clients. At the same time this method guarantees that each connection receives a clean, separate data space, unpolluted by previous connections which is independent of all their instances.

So you can't define which cores will be used.