免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2935 | 回复: 8
打印 上一主题 下一主题

[Web] nginx问题! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-08-29 16:43 |只看该作者 |倒序浏览
nginx的负载均衡有哪些功能呢?

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

   


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

论坛徽章:
0
2 [报告]
发表于 2008-08-31 23:20 |只看该作者
upstream_fair_module

论坛徽章:
0
3 [报告]
发表于 2008-09-01 17:05 |只看该作者
原帖由 uingei 于 2008-8-31 23:20 发表
upstream_fair_module


大虾能说详细点吗??这个模块google都搜不到哦!!!

论坛徽章:
0
4 [报告]
发表于 2008-09-01 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 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.

[ 本帖最后由 tianrenly 于 2008-9-1 21:39 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2008-09-03 15:48 |只看该作者
原帖由 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可以马上识别”!!!

论坛徽章:
0
6 [报告]
发表于 2008-09-06 19:46 |只看该作者
今天用nginx做了负载均衡试验, 发现这个功能默认就是支持了.不用配置

至于原理:猜测应该是相互发包判断

论坛徽章:
0
7 [报告]
发表于 2008-09-09 11:51 |只看该作者
多谢,公司穷,没多余的服务器做测试,有机会我也测试一下!

论坛徽章:
0
8 [报告]
发表于 2008-09-16 12:57 |只看该作者
好像nginx负载均衡是通过随机抛球方法实现的
不是通过统计实现的

论坛徽章:
0
9 [报告]
发表于 2008-09-30 15:24 |只看该作者
nginx在处理外来请求时候进行后端的可用检测,没有专门的检测机制,缺省情况下应该是nginx到后端的请求失败的话,这个后端停用10秒,然后重新启用,跟随外来请求检测
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP