nginx问题!

nginx问题!

nginx的负载均衡有哪些功能呢?

    * 如果后面的服务器其中一台坏了,它能自动识别,更牛的是它好了之后nginx可以马上识别
   


那么大虾知道这ngnix的这个功能使用那部分配置或文件实现的,基本原理是什么?
upstream_fair_module


QUOTE:
原帖由 uingei 于 2008-8-31 23:20 发表
upstream_fair_module

大虾能说详细点吗??这个模块google都搜不到哦!!!
ngx_http_upstream_fair_module
This module is not distributed with the Nginx source. Installation instructions are below.

The upstream_fair module sends an incoming request to the least-busy backend server, rather than distributing requests round-robin.

Example


upstream backend {
    server server1;
    server server2;
    fair;
}

Directives
fair

upstream_fair_shm_size


fair
syntax fair

context upstream

Enables fairness.


upstream_fair_shm_size
syntax upstream_fair_shm_size size

default upstream_fair_shm_size 32k

context main

Size of the shared memory for storing information about the busy-ness of backends. Defaults to 8 pages (so 32k on most systems).


Installation
This module is not distributed with the Nginx source. You can browse its git repository, or download the tar ball(http://github.com/gnosek/nginx-upstream-fair/tarball/master).

After extracting, add the following option to your Nginx ./configure command:


    --add-module=path/to/upstream_fair/directory
Then "make" and "make install" as usual.



QUOTE:
原帖由 tianrenly 于 2008-9-1 21:27 发表
ngx_http_upstream_fair_module
This module is not distributed with the Nginx source. Installation instructions are below.

The upstream_fair module sends an incoming request to the least-busy  ...

这个模块我知道,功能只是负责轮询。

但没有这个功能“如果后面的服务器其中一台坏了,它能自动识别,更牛的是它好了之后nginx可以马上识别”!!!
今天用nginx做了负载均衡试验, 发现这个功能默认就是支持了.不用配置

至于原理:猜测应该是相互发包判断
多谢,公司穷,没多余的服务器做测试,有机会我也测试一下!
好像nginx负载均衡是通过随机抛球方法实现的
不是通过统计实现的
nginx在处理外来请求时候进行后端的可用检测,没有专门的检测机制,缺省情况下应该是nginx到后端的请求失败的话,这个后端停用10秒,然后重新启用,跟随外来请求检测