I have 6 Linux box running RServe and serving same set of R Scripts.
192.168.0.1 : 6311
192.168.0.2 : 6311
...
...
192.168.0.6 : 6311
I connect from java to these Rserve using REngine (Rserve Java Client).
RConnection rServeConnection = new RConnection(R_SERVE_SERVER_ADDRESS, R_SERVE_SERVER_PORT);
Now how do I load balance this ? Preferably in Apache Mod Proxy?
I've tried with httpd websocket load balancing settings and no luck.
Update: Concluded httpd doesn't load balance TCP traffic(Rserve uses TCP, while there are options in Rserve to enable websocket mode, my use case don't need that extra layer). Moved to HAProxy for load balancing with config as in the below link and able to load balance R script requests coming to Rserve with fault tolerance.