Cluster tag

From Resin 3.0

(Difference between revisions)
Jump to: navigation, search
 
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Configuration]] [[Category:Cluster]]
+
{{Cleanup}} [[Category:Configuration]] [[Category:Cluster]]
  
[Clustering and Load Balancing|Cluster] configuration documentation is at [config/balance.xtp@resin-doc].
+
* [[Clustering and Load Balancing|Cluster]] configuration documentation is at http://www.caucho.com/resin/doc/resin-clustering.xtp.
  
h3. <cluster> tag
+
== <cluster> tag ==
  
||tag||description||default
+
{| class="directives"
|id|unique identifier of the cluster|""
+
!directive||description||default
|cluster-ref|use the values from a cluster-definition tag
+
|-
|client-live-time|how long the load-balancer should keep an idle socket open|30s
+
||id||unique identifier of the cluster||""
|client-dead-time|how long the load-balancer should treat a backend as dead|30s
+
|-
|client-read-timeout|timeout of load-balancer reads|30s
+
||cluster-ref||use the values from a [[cluster-definition]] directive
|client-write-timeout|timeout of load-balancer writes
+
|-
|<[srun]>|configures an srun port
+
||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> tag ==
+
== <cluster-definition> directive ==
  
{| class="tags"
+
{| class="directives"
!tag||description||default
+
!directive||description||default
 
|-
 
|-
 
||id||unique identifier of the cluster definition||""
 
||id||unique identifier of the cluster definition||""
Line 34: Line 43:
 
=== example ===
 
=== example ===
  
Clustering and load balancing is configured in a <cluster> tag inside the <[[server]]> block of the resin.conf.
+
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:
 
A cluster with two machines might look like:
Line 56: Line 65:
 
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.
 
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> tag.  The server timeouts are configured in the individual <[[srun]]> tags.
+
The client timeouts are configured directly in the <cluster> directive.  The server timeouts are configured in the individual <[[srun]]> directives.
  
{| class="tags"
+
{| class="directives"
 
||client-read-timeout||How long the frontend should wait on a read before timing out||60s
 
||client-read-timeout||How long the frontend should wait on a read before timing out||60s
 
|-
 
|-
Line 77: Line 86:
 
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.
 
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.
  
{| class="tags"
+
{| class="directives"
 
||read-timeout||How long the backend should wait on a read before timing out||30s
 
||read-timeout||How long the backend should wait on a read before timing out||30s
 
|-
 
|-

Latest revision as of 21:14, 1 December 2011

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