Cluster tag
From Resin 3.0
(Difference between revisions)
(renamed tag to directive) |
|||
Line 3: | Line 3: | ||
[[Clustering and Load Balancing|Cluster]] configuration documentation is at http://www.caucho.com/resin-3.0/config/balance.xtp. | [[Clustering and Load Balancing|Cluster]] configuration documentation is at http://www.caucho.com/resin-3.0/config/balance.xtp. | ||
− | == <cluster> | + | == <cluster> directive == |
− | {| class=" | + | {| class="directives" |
− | ! | + | !directive||description||default |
|- | |- | ||
||id||unique identifier of the cluster||"" | ||id||unique identifier of the cluster||"" | ||
|- | |- | ||
− | ||cluster-ref||use the values from a cluster-definition | + | ||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-live-time||how long the load-balancer should keep an idle socket open||30s | ||
Line 23: | Line 23: | ||
|} | |} | ||
− | == <cluster-definition> | + | == <cluster-definition> directive == |
− | {| class=" | + | {| class="directives" |
− | ! | + | !directive||description||default |
|- | |- | ||
||id||unique identifier of the cluster definition||"" | ||id||unique identifier of the cluster definition||"" | ||
Line 43: | Line 43: | ||
=== example === | === example === | ||
− | Clustering and load balancing is configured in a <cluster> | + | 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 65: | 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> | + | The client timeouts are configured directly in the <cluster> directive. The server timeouts are configured in the individual <[[srun]]> directives. |
− | {| class=" | + | {| 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 86: | 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=" | + | {| 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 | ||
|- | |- |
Revision as of 20:20, 21 February 2006
Cluster configuration documentation is at http://www.caucho.com/resin-3.0/config/balance.xtp.
Contents |
<cluster> directive
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>