Cluster tag

From Resin 3.0

Jump to: navigation, search
40px-Edit-clear.png This article requires cleanup and may refer to a legacy version of Resin.

Please visit http://www.caucho.com/documentation/ for the most up-to-date documentation.

Contents

<cluster> tag

directive description default
id unique identifier of the cluster ""
cluster-ref use the values from a cluster-definition directive
client-live-time how long the load-balancer should keep an idle socket open 30s
client-dead-time how long the load-balancer should treat a backend as dead 30s
client-read-timeout timeout of load-balancer reads 30s
client-write-timeout timeout of load-balancer writes
<srun> configures an srun port

<cluster-definition> directive

directive description default
id unique identifier of the cluster definition ""
client-live-time how long the load-balancer should keep an idle socket open 30s
client-dead-time how long the load-balancer should treat a backend as dead 30s
client-read-timeout timeout of load-balancer reads 30s
client-write-timeout timeout of load-balancer writes
<srun> configures an srun port

example

Clustering and load balancing is configured in a <cluster> directive inside the <server> block of the resin.conf.

A cluster with two machines might look like:

resin.conf

<resin xmlns="http://caucho.com/ns/resin">
...
<server>
  <cluster>
    <client-live-time>30s</client-live-time>

    <srun id="a" host="192.168.0.10" port="6802"/>
    <srun id="b" host="192.168.0.11" port="6803"/>
  </cluster>

  ...
</server>
</resin>

Load Balancing Timeouts

Load balancing has two sets of time outs, one set from the client (front-end) perspective, and one set from the server (back-end) perspective.

The client timeouts are configured directly in the <cluster> directive. The server timeouts are configured in the individual <srun> directives.

client-read-timeout How long the frontend should wait on a read before timing out 60s
client-write-timeout How long the frontend should wait on a write before timing out 60s
client-live-time How long the frontend should keep a socket alive before discarding it 60s
client-dead-time How long the frontend should treat a backend as dead before retrying 15s

resin.conf

<cluster>
  <client-live-time>60s</client-live-time>

  <srun id="a" host="192.168.0.10" port="6802"/>
</cluster>

The server timeouts specify how long the backend will wait for new data from a frontend before giving up. This timeout should be longer than the client-live-time.

read-timeout How long the backend should wait on a read before timing out 30s
write-timeout How long the backend should wait on a write before timing out 30s

resin.conf

<cluster>
  ...
  <srun id="c" host="196.168.0.14" port="6802" read-timeout="120s"/>
  ...
</cluster>


See Also

Clustering and Load Balancing

Personal tools