To utilize the LoadMaster server agent you will need the following:
A LoadMaster installation, running at least LoadMaster version 3.1-57
A Windows Server 2008 server, running IIS (5.0 or later)
The permissions to set up Common Gateway Interface (CGI) applications under IIS
A KEMP LoadMaster determines how to best distribute load among available Real Servers by a variety of methods. These can include the availability of the servers (by doing health checking), as well as both active connections and connection rates to the Real Servers.
It may be beneficial however to also have information on the performance characteristics of the Real Servers themselves. This is possible through the â€œadaptiveâ€ load balancing method in the load balancer. In conjunction with an agent, the LoadMaster can distribute traffic based on the load on the actual server, which can include CPU load, disk load, and other performance metrics.
The LoadMaster Server Agent works by residing on a server and reporting back to the LoadMaster on how loaded the server is. The metrics used to determine the system's load are entirely configurable by the user.
The LoadMaster Agent simply reports a number, between 1 and 100, with 1 being the idlest and 100 being the busiest. The number is determined by the parameters specified in the configuration file. It can include only one performance metric (such as CPU utilization), or be a combination of up to eight different metrics (such as CPU utilization, memory utilization, disk I/O).
The first step is to choose where the agent will reside. The agent exists as a CGI program, and it must be somewhere within the webroot, available to the LoadMaster. The LoadMaster will retrieve the load value through an HTTP call, so it must exist in the webroot.
For instance, if the webroot is C:\Inetpub\wwwroot\site1\, then the agent could be placed in C:\Inetpub\wwwroot\site1\LMagent\.
The two files required are LMperfagent.exe and LMperfagent-config.txt. They must be together in the same directory. There is also a file called LMperfagent-config.xls, which is a file you can edit in Microsoft Excel if you find that easier to work with. If you do edit it in Excel you must save the file as a text file (.txt) as the .xls file will not be read.
If you look at the configuration file (either the .txt file in a text editor, or the .xls file in a spreadsheet editor), you will see that each metric has its own line, and each line consists of five different fields.
The first field is the weight that the specified metric has on the overall performance value reported. The second field is the top range of the value reported by that metric. For example, if you were to measure system memory in terms of megabytes, and the system had 2 GB of internal memory, the maximum value would be 2048. If the memory utilization was 1024, then the value reported would be â€œ50â€, since the memory is 50% utilized.
The third field is weather the value is an up or down value. A good example to illustrate the difference between and up or down metric would be a metric that reports memory. If the metric reports memory available, then it would be a â€œdownâ€ metric. As the metric value goes down, the value reported would go up. A system with 2048 MB of RAM that reports 0 memory available would be a fully utilized system, so it would report 101.
If the metric reported memory utilized, a value of 2048 MB of RAM would mean no RAM was being used, and the value reported would be 1. If the memory utilized shot up to 2048, then the value reported would be 101.
The fourth field is the hard limit value. Setting a value here will cause the agent to override all other metrics, and ignores their weights, and report a 100% loaded condition if this threshold is reached. This could be used for CPU utilization.
If you have CPU weighted to 50%, and you have disk I/O and pages per second each weighted at 25%, you can have a situation where disk I/O and pages per second are nearly at zero, but the CPU hits 100%. In that situation, the agent would report 50% utilization to the LoadMaster. If there is a hard limit set at 100 for CPU - if the CPU hit 100 the agent would report 101.
And the fifth field is the metric itself. A list of available metrics can be found in the example configuration file. Additional information is available in the README file.
Once the files are in place, and the configuration is set (adjustments can be made later, of course), then IIS needs to be configured.
1. First, open the IIS configuration manager by navigating to Control Panel > Administrative Tools, and opening Internet Information Services (IIS) Manager.
2. Click the Web Service Extensions folder in the left panel and click Add a new Web service extension... on the right.
3. Enter LMperfagent.exe as the extension name and click Add.
4. Browse for and select the LMperfagent.exe file.
5. Go to Web Sites in the main window. Select your site and select Properties.
6. Select the Home Directory tab.
7. Select Scripts and Executables in the Execute permissions drop-down list.
8. Click the Configuration... button.
9. Click Add.
10. For executable, select the LMPerfagent.exe file, and enter in exe under extension.
11. Remove the tick from the Script engine checkbox, and click OK.
There is one more step required; set the Windows registry to provide access to the perflib counters to the agent.
1. Open the Registry Editor, by clicking Start, selecting Run, and entering regedit.
2. In the panel on the left, navigate to HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows NT > CurrentVersion > Perflib.
3. Select Permissions for Perflib.
4. Select Add.
5. The group being added is called Everyone.
6. Once that has been added, â€œEveryoneâ€ will have no read/write permissions. Select the box that gives read permission, and click Apply.
Do NOT give Perflib write permissions.
The setup can be tested by navigating to the URL in any browser. A number should immediately appear. The browser can be used to help tweak the results reported.
Repeat the above steps for each Real Server that to be included in adaptive load balancing.
All Real Servers configured on a LoadMaster do not necessarily need to have an agent installed. However, all Real Servers in a Virtual Service that is configured for adaptive load balancing do need to have the agents configured.
In the LoadMaster Web User Interface (WUI), select the Rules & Checking link in the main menu, and then select Check Parameters. The configuration options for adaptive metrics should appear.
If the Adaptive Parameters section is not on this screen it may be due to the Scheduling Method that is selected in the Virtual Services. In order to see the Adaptive Parameters section on this screen, the Scheduling Method must be set to resource based (adaptive) for at least one Virtual Service.
The Adaptive Interval (sec) determines how often the adaptive value is pulled. The Adaptive URL tells the LoadMaster where to find the value. Port specifies which port the web server is answering on.
If the webroot for â€œ/â€ is C:\Inetpub\wwwroot\site1\, and the agent is located in C:\Inetpub\wwwroot\site1\LMagent\LMperfagent.exe, then the Adaptive URL should be changed to /LMagent/LMperfagent.exe.
After the Adaptive URL is input, press Enter on the keyboard and the changes will be saved.
The Min. Control Variable Value is a percentage that specifies a threshold below which the balancer will switch to static weight-based scheduling, i.e. normal Weighted Round Robin. The value is a percentage of the maximum load, but maximum value permitted is 50. The default is 5.
The Min. Weight Adjustment Value is a percentage that specifies the minimum weight that can be assigned to a server, as a percentage of the initial static weight it was given. For example, if the server was given 100 to start with and this adjustment value is 10, then the weight will never be set to below 10. A value of 5 is recommended, and the maximum value is 50.
Once the global settings are configured and the agent has been installed on the Real Servers, adaptive load balancing can be enabled on a per-Virtual Service basis. In the properties for each Virtual Service, there will be an option to select the Scheduling Method. Select resource based (adaptive) to enable adaptive load balancing.
When adaptive scheduling is enabled, the latest value can be seen as polled by the LoadMaster in the Real Servers Statistics page.
If the KEMP LoadMaster fails to retrieve an adaptive value from a Real Server, it will automatically assign an adaptive value of â€œ100â€ to that Real Server. This will cause it to be given the least load possible.
This document was last updated on 12 October 2017.