TAF与负载均衡

原创 2013年12月05日 23:46:19
(1) Client Side Connect-Time Load Balance (客户端连接时负责均衡配置)

The client load balancing feature enables clients to randomize connection requests among the listeners.

Tnsnames Parameter: LOAD_BALANCE

load_balance的值可以设置为:on | off | yes | no | true | false

load_balance=yes|on|true 设置为客户端随机在所提供的listener address中根据Load选择最适合的listener。

load_balance=no|off|false 设置为客户端在所提供的listener address中按次序选择listener,一直到选择到可以连接的Listener。


The (load_balance=yes) instructs SQLNet to progress through the list of listener addresses in a random sequence, balancing the load on the various listeners. When set to OFF, instructs SQLNet to try the addresses sequentially until one succeeds.

Load balancing can be specified for an ADDRESS_LIST or associated with a set of ADDRESSes or set DESCRIPTIONs.

This parameter must be correctly coded in your net service name (connect descriptor).

By default, this parameter is set to ON for DESCRIPTION_LISTs.

This can even be achieved with a single net service name provided you configure
a) Multiple listener addresses within a description
b) Multiple descriptions within a description list
The difference between the two is that while the former will use the same connect data for all the listener addresses, that latter may have separate connect data for each configured listener address. Below, I provide an example of both types of configuration:
Multiple Listener addresses within a description:


load_balance默认值为on


If you use ADDRESS_LIST, (load_balance=yes) should be within the (ADDRESS_LIST=) portion. If you do not use ADDRESS_LIST, (load_balance=yes) should be within the (description=) portion.

(2) Client Side Connect-Time failover(客户端连接时故障切换配置)

连接到初始监听失败时,会自动切换到下一个监听进行重试。

The connect-time failover enables clients to connect to another listener if the initial connection to the first listener fails. The number of listener protocol addresses determines how many listeners are tried. Without connect-time failover, Oracle Net attempts a connection with only one listener. The default is on.

Tnsnames Parameter: FAILOVER

(failover=on) is default for ADDRESS_LISTs, DESCRIPTION_LISTs, and a set of

DESCRIPTIONs., therefore, you do not have to specify it explicitly. 



(3) Server Side Listener Connection Load Balance(服务端监听连接负载均衡)

The listener connection load balancing feature improves connection performance by balancing the number of active connections among multiple dispatchers and instances. In a single-instance environment, the listener selects the least loaded dispatcher to handle the incoming client requests. In an Oracle Real Application Clusters (RAC) environment, connection load balancing also has the capability to balance the number of active connections among multiple instances.
1. Least-loaded node
2. Least-loaded instance
3. Least-loaded dispatcher for that instance (in case of Shared server configuration)


There are two types of server-side load balancing:

Load Based — Server side load balancing redirects connections by default depending on node load. From 10.2 onwards you can work this with Load balancing advisory (LBA). This will not be effective for login storms as the connections are already in the listener after which PMON update on the load comes to the listener.
Session Based — Session based load balancing takes into account the number of sessions connected to each node and then distributes the connections to balance the number of sessions across the different nodes.
Session count balancing is used when you set a listener parameter, PREFER_LEAST_LOADED_NODE_<listener_name>=OFF (<listener_name> is the actual name of the listener which is different on each node in your cluster and by default is constructed as "listener_<nodename>"). Please be aware that connections bursts (large number of connections initiated very quickly one after another) may not be properly balanced due to statistics update latency. 


服务端监听连接负载均衡有2种类型:

基于负载,由PMON定期更新节点的负载情况,为客户端连接分配到较轻负载的监听上。

基于session数,选择session数少的节点监听进行连接,设置PREFER_LEAST_LOADED_NODE_<listener_name>=OFF即启用基于session数负载均衡连接。

值得注意的是,这两种负载均衡方式对于阻止连接风暴(即短时间内大量客户连接请求)来说都是无能为力的。



Oracle11g RAC 服务器端TAF功能配置

TAF定义 Transparent Application Failover(透明应用故障转移)是JDBC和OCI驱动的一个特性。当会话连接的数据库实例发生宕机时TAF允许应用程序自动重新连接到数据...
  • lzw5210
  • lzw5210
  • 2017年03月03日 16:23
  • 235

负载均衡的搭建方案

负载均衡是一个很大的话题,也是一个很小的话题,小到一个基本理念,你必须通过负载均衡提供多点服务。在架构搭建的最初最初阶段,就应该实施非单点服务的架构体系,这样才可以确保业务不被中断。...
  • zoujunjie202
  • zoujunjie202
  • 2016年10月07日 14:33
  • 3075

六大Web负载均衡原理与实现

开头先理解一下所谓的“均衡” 不能狭义地理解为分配给所有实际服务器一样多的工作量,因为多台服务器的承载能力各不相同,这可能体现在硬件配置、网络带宽的差异,也可能因为某台服务器身兼多职,我们所说的“均...
  • asqi1
  • asqi1
  • 2014年11月25日 10:40
  • 5655

【Nginx】实现负载均衡的几种方式

要理解负载均衡,必须先搞清楚正向代理和反向代理。正向代理与反向代理【总结】注: 正向代理,代理的是用户。 反向代理,代理的是服务器 什么是负载均衡当一台服务器的单位时间内的访问量越大时,服务器压力就越...
  • qq_28602957
  • qq_28602957
  • 2017年03月12日 11:59
  • 3392

负载均衡原理的解析

开头先理解一下所谓的“均衡” 不能狭义地理解为分配给所有实际服务器一样多的工作量,因为多台服务器的承载能力各不相同,这可能体现在硬件配置、网络带宽的差异,也可能因为某台服务器身兼多职,我们所说...
  • lsblsb
  • lsblsb
  • 2017年06月07日 15:17
  • 540

一个高性能RPC框架原理剖析

业务与底层网络通信分离 Server大部分主要分为两层: 网络接收层:负责监听端口,负责收包,编码,解码工作,负责将响应包回传给客户端。业务处理层:负责接收网络接收层完整的包,如果是RPC...
  • turkeyzhou
  • turkeyzhou
  • 2013年04月04日 19:07
  • 23270

每天进步一点点——负载均衡之反向代理

2分钟理解分布式负载均衡之反向代理服务器
  • cywosp
  • cywosp
  • 2014年07月22日 00:39
  • 11571

架构设计:负载均衡层设计方案(1)——负载场景和解决方式

在上一篇《标准Web系统的架构分层》文章中,我们概述了WEB系统架构中的分层架设体系,介绍了包括负载均衡层、业务层、业务通信层、数据存储层的作用和存在意义。从本片文章开始,我们将首先详细讲解负载均衡层...
  • yinwenjie
  • yinwenjie
  • 2015年08月30日 09:33
  • 27499

apache做负载均衡器 配置

将Apache作为LoadBalance前置机分别有三种不同的部署方式,分别是: 1 )轮询均衡策略的配置 进入Apache的conf目录,打开httpd.conf文件,在文件的末尾加入:...
  • lzlchangqi
  • lzlchangqi
  • 2014年09月23日 17:51
  • 6800

浅谈Nginx负载均衡原理与实现

1 负载均衡 先来简单了解一下什么是负载均衡,单从字面上的意思来理解就可以解释N台服务器平均分担负载,不会因为某台服务器负载高宕机而某台服务器闲置的情况。那么负载均衡的前提就是要有多台服务器才能...
  • u012517198
  • u012517198
  • 2016年03月17日 09:27
  • 12036
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:TAF与负载均衡
举报原因:
原因补充:

(最多只允许输入30个字)