To utilize the LoadMaster server agent you must have the following:
- A LoadMaster installation running at least LoadMaster version 5.1-74
- A Windows Server 2008 server running IIS (5.0 or later)
- The permissions to set up Common Gateway Interface (CGI) applications under IIS
The 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 distributes 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 Common Gateway Interface (CGI) program and it must be somewhere within the webroot, available to the LoadMaster. The LoadMaster retrieves 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) because the .xls file cannot 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 can see that each metric has its own line and each line consists of five different fields:
- WEIGHT (% of 100): The weight that the specified metric has on the overall performance value reported. If the value does not add up to 100, you may experience configuration errors.
- MAX VALUE: The top range of the value reported by that metric. For example, if you were to measure system memory and the system had 2 GB of internal memory, the maximum value would be 2048 MB. If the memory utilization was 1024 MB, the value reported is â€œ50â€, since the memory is 50% utilized.
- DIRECTION: The direction column indicates if the value is an up or down value. A good example to illustrate the difference between and up or down metric is a metric that reports memory. If the metric reports memory available, then it is a â€œdownâ€ metric. As the metric value goes down, the value reported goes up. A system with 2048 MB of RAM that reports 0 memory available is a fully utilized system, so it reports 101.
If the metric reports memory utilized a value of 2048 MB of RAM means that no RAM is being used. The value reported in this case is 1. If the memory utilized shot up to 2048, then the value reported is 101.
- HARD LIMIT VALUE: Setting a value here causes the agent to override all other metrics and ignore their weights. The agent reports 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 reports 50% utilization to the LoadMaster. If there is a hard limit set at 100 for CPU - if the CPU hit 100 the agent reports 101.
- COUNTER: The metric itself. A list of available metrics is in the example configuration file. Additional information is available in the README file.
The configuration file must be written in the same language as the server system. The file you download will not work correctly if the server is running the system language as German, for example.
After the files are in place and the configuration is set (adjustments can be made later, of course), then IIS must 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. Type LMperfagent.exe as the extension name and click Add.
4. Browse to 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 Configuration.
9. Click Add.
10. For executable, select the LMPerfagent.exe file and enter in exe under extension.
11. Clear the Script engine check box 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 - click Start, select Run, and enter 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â€ does not have read/write permissions. Select the box that gives read permission, and click Apply.
Do NOT give Perflib write permissions.
Test the setup by navigating to the URL in any browser. A number should immediately appear. You can use the browser to help tweak the results reported.
Repeat the above steps for each Real Server 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 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. 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 instructs 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 are saved.
The Min. Control Variable Value is a percentage that specifies a threshold below which the balancer switches to static weight-based scheduling, that is, 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 is 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 is 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 is an option to select the Scheduling Method. Select resource based (adaptive) to enable adaptive load balancing.
When adaptive scheduling is enabled, the latest value as polled by the LoadMaster is available in the Real Servers Statistics page.
If the KEMP LoadMaster fails to retrieve an adaptive value from a Real Server, it automatically assigns an adaptive value of â€œ100â€ to that Real Server. This causes it to be given the least load possible.
Common error codes and their meanings are listed below:
- 1 â€“ Unable to open the local LMperfagent-config.txt file
- 2 â€“ Unable to open a performance query
- 3 â€“ Error collecting performance query data
- 4 â€“ Error closing performance query
This document was last updated on 28 March 2018.