Load Distribution and Failover

RoboServer prod = new RoboServer("prod.kapow.local", 50000);
RoboServer prod2 = new RoboServer("prod2.kapow.local", 50000);
Cluster cluster = new Cluster("Prod", new RoboServer[]{ prod, prod2}, false);

Load balanced executor

Let's look a little closer at what happens inside the RequestExecutor. The executor is given an array of RoboServers. As the executor is constructed it tries to connect to each RoboServer. Once it is connected it sends a ping request to each RoboServer to discover how the server is configured.

Load is distributed to each online RoboServer in the cluster, based on the number of unused execution slots on the RoboServer. The next request is always distributed to the RoboServer with the most available slots. The number of available execution slots is obtained through the initial Ping response, and the executor keeps track of each robot it starts and when it completes. The number of execution slots on a RoboServer is determined by the max concurrent robots on the Servers tab.

If a RoboServer goes offline it will not receive any robot execution requests before it has successfully responded to the ping request.

Two client rule

You should only have one API client using a given cluster of RoboServer. If you have multiple JVMs running robots against the same RoboServers, this will result in reduced performance.