Oracle RAC load Balancing test (combined with server-side vs. client)

Source: Internet
Author: User

Oracle RAC Load Balancing enables client-initiated connections to be efficiently allocated to instances with smaller listener loads. There are two ways to achieve client load balancing, one is by configuring the client's load_balance, one by configuring the server-side Remote_listener parameters. Both approaches have advantages and disadvantages, and they are not mutually exclusive, so they can be combined in two ways to achieve more efficient load balancing. This article describes the use of both combinations (Oralce 10g RAC).

For a separate test of client and server load Balancing, refer to:
Oracle RAC Client Connection Load balancer (load Balance)
Oracle RAC server-side Connection load balancing (load Balance)

The tests in this article will be combined with the script and sample used in the previous article, which is a summary of the first two Tests.

First, configuration requirements

[SQL]View PlainCopyprint?
  1. 1, server-side listener normal service, if the use of non-default 1521 port, please refer to the ORACLE RAC non-default port monitoring configuration (Listener.ora Tnsnames.ora)
  2. [Email protected]:~> more $ORACLE _home/network/admin/listener.ora
  3. # LISTENER.ORA.BO2DBP Network Configuration File:/U01/ORACLE/DB/NETWORK/ADMIN/LISTENER.ORA.BO2DBP
  4. # Generated by Oracle configuration tools.
  5. LISTENER_BO2DBP =
  6. (Description_list =
  7. (DESCRIPTION =
  8. (address = (PROTOCOL = TCP) (HOST = bo2dbp-vip.2gotrade.com) (PORT = 1521) (IP = First )
  9. (address = (PROTOCOL = TCP) (HOST = 192.168.7.51) (PORT = 1521) (IP = First )
  10. )
  11. )
  12. SID_LIST_LISTENER_BO2DBP =
  13. (Sid_list =
  14. (Sid_desc =
  15. (Sid_name = Plsextproc)
  16. (Oracle_home =/u01/oracle/db)
  17. (program = Extproc)
  18. )
  19. )
  20. [Email protected]:~> lsnrctl Status
  21. Service "GOBO4" has 2 instance (s).
  22. Instance "gobo4a", status ready, have 2 handler (s) for the This service ...
  23. Instance "gobo4b", status ready, have 1 handler (s) for the This service ...
  24. 2, the server side of the Remote_listener parameter settings
  25. The connection identifier that requires the Remote_listener parameter has a corresponding entry in the server-side Tnsnames.ora
  26. Sql> Show Parameter Listener
  27. NAME TYPE VALUE
  28. ------------------------------------ ----------- ------------------------------  
  29. Local_listener string
  30. Remote_listener string Remote_lsnr_gobo4
  31. [Email protected]:~> more $ORACLE _home/network/admin/tnsnames.ora
  32. # Tnsnames.ora Network Configuration File:/u01/oracle/db/network/admin/tnsnames.ora
  33. # Generated by Oracle configuration tools.
  34. Remote_lsnr_gobo4 =
  35. (Address_list =
  36. (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.61) (PORT = 1521))
  37. (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.62) (PORT = 1521))
  38. )
  39. 3. Enable Load_balance in client Tnsnames.ora
  40. [Email protected]:~> tail-11 $ORACLE _home/network/admin/tnsnames.ora
  41. GOBO4 =
  42. (DESCRIPTION =
  43. (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.61) (PORT = 1521))
  44. (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.62) (PORT = 1521))
  45. (load_balance = yes)
  46. (Connect_data =
  47. (SERVER = dedicated)
  48. (service_name = GOBO4)
  49. )
  50. )

Second, test load Balance

[Python]View PlainCopyprint?
    1. #还是使用之前的脚步来进行测试
    2. #Author: Robinson
    3. #Blog: http://blog.csdn.net/robinson_0612
    4. [Email protected]:~> more load_balance.sh
    5. #!/bin/bash
    6. For I in {1 ... +}
    7. Do
    8. Echo $i
    9. Sqlplus-s System/[email protected] <<eof
    10. Select instance_name from v\ $instance;
    11. Eof
    12. Sleep 1
    13. Done
    14. Exit 0
    15. [Email protected]:~>./load_balance.sh >load_bal.log
    16. #查看日志
    17. [Email protected]:~> grep gobo4a Load_bal.log |wc-l
    18. 750
    19. [Email protected]:~> grep gobo4b Load_bal.log |wc-l
    20. 250
    21. #查看监听器的日志
    22. [Email protected]:/u01/oracle/db/network/log> grep Establish Listener_bo2dbp.log |wc-l
    23. 894
    24. [Email protected]:/u01/oracle/db/network/log> grep Instance_name=gobo4 Listener_bo2dbp.log |wc-l
    25. 415
    26. #从上面的查询中可以得知, the node BO2DBP received a total of 894 connection requests, and 415 connection requests were forwarded by Bo2dbs.
    27. #因此, actually the number of actual connection requests initiated from the client to BO2DBP is 894-415=479
    28. #下面来看在节点bo2dbs上的监听日志
    29. [Email protected]:/u01/oracle/db/network/log> grep Establish Listener_bo2dbs.log |wc-l
    30. 665
    31. [Email protected]:/u01/oracle/db/network/log> grep Instance_name=gobo4 Listener_bo2dbs.log |wc-l
    32. 144
    33. #从上面的查询中可知, the node Bo2dbs received a total of 665 connection requests, while 144 connection requests were forwarded by BO2DBP.
    34. #因此, actually the number of actual connection requests initiated from the client to Bo2dbs is 655-144=511
    35. #从上面的结果可知,
    36. #基于客户端的连接请求数为节点bo2dbp为479, node Bo2dbs is 511
    37. #监听器路由到本地实例数目为, node bo2dbp,479-144=335, node bo2dbs,511-415=96
    38. #远程监听器路由道本地实例的数据为, node BO2DPB is 415, node Bo2dbs is 144
    39. #监听器路由的概念是指基于服务器端的负载均衡
    40. #即服务器端的监听器根据自身以及远程监听器的负载情况来确定将当前的连接请求转发到本地或远程, this is the route.
    41. Ext.: http://blog.csdn.net/leshami/article/details/8072367

Oracle RAC load Balancing test (combined with server-side vs. client)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.