Rserve - Multiple instances on one server?

≯℡__Kan透↙ 提交于 2019-12-10 15:58:53

问题


Is it possible to run multiple instances of Rserve on one server at the same time?

For example 10 instances meaning 10 separate R workspaces listening on different ports via Rserve on the same machine?


回答1:


Answer is yes, if it is Unix/Linux. Answer is no, if it is Windows. More can be found here http://www.ci.tuwien.ac.at/Conferences/DSC-2003/Proceedings/Urbanek.pdf, page 2 says it explicitly.




回答2:


In the same document specified by @Oleksandr, it clearly states on page 5-6, that in Windows, there is an alternative solution:

Don't run 1 Rserve process, but start multiple Rserve processes, each on a different port (which can be easily specified in the rserve command). Each Rserve process has its own environement. Connect 1 thread of your application with 1 unique Rserve connection: Then you can exploit parallellism from within your application.

So the answer to your question is: Yes, you can.

I've tested this with a C# application, and it works. You can use libraries like this: https://github.com/kent37/RserveCLI2

EDIT August 4 2015: We are now effectively using this in a (windows) production application, namely calling the R code from a C# codebase do to the statistical analysis. We use RServe and RServeCLI for connecting and communication between the 2 codebases. To implement this in a structured manner, we used this pattern for pooled resources. Hope this helps.



来源:https://stackoverflow.com/questions/21580654/rserve-multiple-instances-on-one-server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!