Optimal Hosting for Analysis Analysis Rails Application
I am developing a web application that performs regression analysis on user data.
on the server, RoR executes the application logic and all statistical analysis is done by R (since Ruby has bad stat packages).
Given that both R and RoR are single-threaded, and that the application is expected to be used by multiple users concurrently, I need your advice on optimal configuration.
eg: should I run R and RoR machines in separate instances and maintain RR to R communication via REST? run both on the same computer that can be grouped? use revolutionary analytics?
What would be a good hosting configuration to provide scalability for my application?
source to share
You can create a proxy to communicate with multiple web servers, and in turn, each of these web servers communicates through the proxy with multiple R_servers. To get the proxies to load balance you can look something like Nginx directives up.
The diagram below shows 3 web servers (which are exact clones of each other) and 3 R_servers (which are exact clones of each other). Use whatever you need as it is easy to add / remove webservers or R_servers to scale horizontally.
webserver1 R_server1
/ \ /
proxy - webserver2 - proxy - R_server2
\ / \
webserver3 R_server3
source to share
Take a look at Rserve which, when hosted on Linux, will deploy a new instance for each connection.
Network connection and there are Ruby clients available as indicated by google search
source to share