文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Cluster

Cluster

时间:2006-06-23  来源:softiger

Cluster

From ResinWiki

Cluster configuration documentation is at http://www.caucho.com/resin-3.0/config/balance.xtp.

Contents

  • 1 <cluster> directive
  • 2 <cluster-definition> directive
    • 2.1 example
      • 2.1.1 resin.conf
  • 3 Load Balancing Timeouts
    • 3.1 resin.conf
    • 3.2 resin.conf
  • 4 See Also
[edit]

<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
[edit]

<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
[edit]

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:

[edit]

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> 
[edit]

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
[edit]

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
[edit]

resin.conf

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


排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载