• No results found

Configuring servers and the BIG-IP Controller for Dynamic Ratio load balancing

In document BIG-IP Reference Guide (Page 39-46)

You can configure Dynamic Ratio load balancing on RealNetworks RealServer platforms, Windows platforms equipped with Windows Management Instrumentation (WMI), or any server equipped with an SNMP agent such as the UC Davis SNMP agent or Windows 2000 Server SNMP agent.

Configuring RealNetwork RealServers

For RealNetworks, we provide a monitor plugin for the server that gathers the necessary metrics. Configuring a RealServer for Dynamic Ratio load balancing consists of four tasks: • Installing the monitor plugin on the RealServer

• Configuring a real_server health check monitor on the BIG-IP Controller

• Associating the health check monitor with the server to gather the metrics

• Creating or modifying the server pool to use Dynamic Ratio load balancing

To install the monitor plugin on the RealServer

1. Download the monitor plugin F5RealMon.dll from the BIG-IP Controller. The plugin is located in

/usr/contrib/f5/isapi.

2. Copy F5RealMon.dll to the RealServer Plugins directory. (For example, C:\Program Files\RealServer\Plugins.) 3. If the RealServer process is running, restart it.

To configure a real_server monitor for the server node

Using the Configuration utility or bigpipe, create a health check monitor using the real_server monitor template. The real_server

monitor template is shown in the following figure:

The real_server monitor template may be used as is, without modifying any of the attributes. Alternatively, you may add metrics and modify metric attribute values. To do this, you will need to create a custom monitor. For example:

b monitor my_real_server ’{ use real_server metrics "ServerBandwidth:2.0" }’

monitor type real_server { interval 5

timeout 16 dest *.12345 method "GET"

cmd "GetServerStats"

metrics "ServerBandwidth:1.5,CPUPercentUsage, MemoryUsage, TotalClientCount"

agent "Mozilla/4.0 (compatible: MSIE 5.0; Windows NT) }

The complete set of metrics and metric attribute default value is shown in Table 1.3.

The metric coefficient is a factor determining how heavily the metric’s value counts in the overall ratio weight calculation. The metric threshold is the highest value allowed for the metric if the metric is to have any weight at all. To understand how to use these values, it is necessary to understand how the overall ratio weight is calculated. The overall ratio weight is the sum of relative weights calculated for each metric. The relative weights, in turn, are based on three factors:

• the value for the metric returned by the monitor • the coefficient value

• the threshold value

Metric Default Coefficient Default Threshold

ServerBandwidth (Kbps) 1.0 10,000 CPUPercentUsage 1.0 80 MemoryUsage (Kb) 1.0 100,000 TotalClientCount 1.0 1,000 RTSPClientCount 1.0 500 HTTPClientCount 1.0 500 PNAClientCount 1.0 500 UDPTransportCount 1.0 500 TCPTransportCount 1.0 500 MulticastTransportCount 1.0 500

Given these values, the relative weight is calculated as follows:

w=((threshold-value)/threshold)*coefficient

You can see that the higher the coefficient, the greater the relative weight calculated for the metric. Similarly, the higher the threshold, the greater the relative weight calculated for any metric value that is less than the threshold. (When the value reaches the threshold, the weight goes to zero.)

Note that the default coefficient and default threshold values shown in Table 1.3 are metric defaults, not template defaults. The template defaults take precedence over the metric defaults, just as user-specified values in the custom real_server monitor take precedence over the template defaults. For example, in Figure 1.2, the template specifies a coefficient value of 1.5 for

ServerBandwidth and no value for the other metrics. This means that the template will use the template default of 1.5 forthe

ServerBandwidth coefficient and the metric default of 1 for the coefficients of all other metrics. However, if a custom monitor

my_real_server were configured specifying 2.0 as the

ServerBandwidth coefficient, this user-specified value would override the template default.

The syntax for specifying non-default coefficient or threshold values is:

<metric>:<coefficient |<*>:<threshold>

The following examples show how to specify a coefficient value only, a threshold value only, and a coefficient and a threshold value both:

b monitor my_real_server ’{ use real_server metrics CPUPercentUsage:1.5 }’ b monitor my_real_server ’{ use real_server metrics

CPUPercentUsage:*:70 }’

b monitor my_real_server ’{ use real_server metrics CPUPercentUsage:1.5:70 }’

Metric coefficient and threshold are the only non-template defaults. If a metric not in the template is to be added to the custom monitor, it must be added to the metric list:

To associate the monitor with the member node

Associate the custom health check monitor with the server node, creating an instance of the monitor for that node:

b node <node_addr> monitor use my_real_server

To set the load balancing method to Dynamic Ratio

Create or modify the load balancing pool to which the server belongs to use Dynamic Ratio load balancing:

b pool <pool_name> { lb_method dynamic_ratio <member definition>... }

Configuring Windows servers with WMI

For Windows, we provide a Data Gathering Agent F5Isapi.dll for the server. Configuring a Windows platform for Dynamic Ratio load balancing consists of four tasks:

• Installing the Data Gathering Agent F5Isapi.dl on the server • Configuring a wmi health check monitor on the BIG-IP

Controller

• Associating the health check monitor with the server to gather the metrics

• Creating or modifying the server pool to use Dynamic Ratio load balancing

To install the Data Gathering Agent (F5Isapi) on the server

1. Download the Data Gathering Agent (F5Isapi.dll) from the BIG-IP Controller. The plugin is located in

/usr/contrib/f5/isapi. Copy it to the directory

C:\Inetpub\scripts.

2. Open the Internet Services Manager.

3. In the left pane of the Internet Services Manager, open the folder <machine_name>\Default Web Site\Script, where

<machine_name> is the name of the server you are configuring. The contents of Scripts folder will open in the right pane.

4. In the right pane, right click on F5Isapi.dll and select

5. On the Properties box, unselect Logvisits. (Logging of each visit to the agent quickly fills up the log files.) 6. On the Properties box, click the File Security tab. The

File Security options will appear.

7. In the Anonymous access and authentication control group box, click Edit. The Authentication Methods box will open.

8. In the Authentication methods box, clear all check boxes, then select Basic Authentication.

9. In the Authentication methods box, click OK to accept the changes.

10. In the Properties box, click Apply. The WMI Data Gathering Agent is now ready to be used.

To configure a wmi monitor for the server node

Using the Configuration Utility or bigpipe, create a health check monitor using the wmi monitor template. The wmi monitor template is shown in Figure 1.3.

monitor type wmi { interval 5 timeout 16 dest *:12346 username "" password "" method "POST" urlpath "/scripts/F5Isapi.dll"

cmd "GetCPUInfo, GetDiskInfo, GetOSInfo"

metrics "LoadPercentage, DiskUsage, PhysicalMemoryUsage:1.5, VirtualMemoryUsage:2.0"

post "<input type=’hidden’ name=’RespFormat’ value=’HTML’>" agent "Mozilla/4.0 (compatible: MSIE 5.0; Windows NT) }

The monitor template contains default values for all the attributes. These are template defaults. In creating a custom monitor from the template, the only default values you are required to change are the null values for username and password. For example:

b monitor my_wmi ’{ use wmi username "dave" password "$getm" }’

You may also add commands and metrics and modify metric attribute values. The complete set of commands, associated metrics and metric attribute default values are shown in Table 1.4.

Command Metric Default Coefficient Default Threshold GetCPUInfo LoadPercentage (%) 1.0 80 GetOSInfo PhysicalMemoryUsage (%) 1.0 80 VirtualMemoryUsage (%) 1.0 80 NumberRunningProcesses 1.0 100 GetDiskInfo DiskUsage (%) 1.0 90 GetPerfCounters TotalKBytesPerSec 1.0 10,000 ConnectionAttemptsPerSec 1.0 500 CurrentConnections 1.0 500 GETRequestsPerSec 1.0 500 PUTRequestsPerSec 1.0 500 POSTRequestsPerSec 1.0 500 AnonymousUsersPerSec 1.0 500 CurrentAnonymousUsers 1.0 500 NonAnonymousUsersPerSec 1.0 500

For more information about the metric coefficients and thresholds, refer to the description accompanying Table 1.3, real_server monitor metrics on page 1-14. Note that for a wmi monitor you may add commands. To do this, simply add them to the cmd list.

To associate the monitor with the member node

Associate the custom health check monitor with the server node, creating an instance of the monitor for that node:

b node <node_addr> monitor use my_wmi

To set the load balancing method to Dynamic Ratio

Create or modify the load balancing pool to which the server belongs to use Dynamic Ratio load balancing:

b pool <pool_name> { lb_method dynamic_ratio <member definition>... }

In document BIG-IP Reference Guide (Page 39-46)

Related documents