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 Input/Output (I/O)).
The purpose of this document is to provide step-by-step instructions on how to install Adaptive Agent and configure the LoadMaster to use it. This document provides steps on how to install Adaptive Agent on Windows Server 2012 or 2016. For instructions on previous versions of Windows Server, refer to the Install Adaptive Agent â€“ Windows 2008, Technical Note document.
This document is intended to be read by anyone who is interested in finding out how to install the Adaptive Agent tool.
There are some prerequisites that must be in place before installing Adaptive Agent:
- Download the agent by clicking the link in the following KEMP Help Center article: LoadMaster Adaptive Agent for Microsoft Windows.
- Transfer the agent to the server.
- Administrative access to the server.
Follow the steps in the sections below to install Adaptive Agent on Windows Server 2012 or 2016.
Create a user called lmagent and ensure the user is a member of the Performance Monitor Users group. To do this, follow the steps below:
1. Log in to Windows Server 2012 or 2016 as an administrator.
2. From the Start menu, click Administrative Tools.
3. Double-click Computer Management.
4. Expand Local Users and Groups.
5. Click Users.
6. Select Action from the application menu and click New User.
7. Type lmagent as the User name and Full name.
8. Type a Description, for example LoadMaster Agent.
9. Fill out the other fields as needed. A password can be set but is not required.
10. Click Create.
11. Click Close.
12. Right-click lmagent and select Properties.
13. Select the Member Of tab.
14. Click Add.
15. In the Enter the object names to select field, enter Performance Monitor Users.
16. Click Check Names.
17. Click OK.
As an administrator, install the Internet Information Server by following the steps below:
1. From the Start menu, click Server Manager.
2. Click the Add roles and features link.
3. Click Next.
4. Select Role-based or feature-based installation.
5. Select the Select a server from the server pool option.
6. Select the appropriate server.
7. Click Next.
8. Select the server in the Server Pool section.
9. Click Next.
10. Expand Application Development. Select CGI.
11. Click Next.
12. Click Install.
13. Verify the installation of IIS by browsing to http://localhost.
To install Adaptive Agent, follow the steps below:
1. Log in to Windows Server 2012 or 2016 as an administrator.
2. Create a folder called load in the default IIS web root.
The default IIS web root is usually C:\inetpub\wwwroot.
3. Decompress the agent files (downloaded from here: LoadMaster Adaptive Agent for Microsoft Windows).
4. Copy the Lmperfagent.exe and LMperfagent-config.txt files into the load directory.
5. Open the Internet Information Services (IIS) Manager.
6. Select the relevant connection on the left.
7. Double-click ISAPI and CGI Restrictions.
8. Click Add on the right in the Actions section.
9. Navigate to LMperfagent.exe.
10. Change the drop-down to .exe.
11. Select LMperfagent and click Open.
12. Type a Description, for example LMperfagent.
13. Select Allow extension path to execute.
14. Click OK.
15. Expand the Sites folder on the left.
16. Expand Default Web Site.
17. Right-click the load folder and select Convert to Application.
18. Ensure to configure the Connect as to use the lmagent user.
The lmagent user was created in the Create a Dedicated User for Executing the Adaptive Agent section.
19. Verify that the settings are correct by using the Test Settings feature.
20. Select Default Web Site in the Connections section.
21. Double-click Handler Mappings.
22. Select CGI-exe.
23. Click Edit Feature Permissions on the right in the Actions section.
24. Select the Execute check box.
25. Click OK.
26. Test by going to http://localhost/load/LMperfagent.exe in a web browser.
27. A value between 0 and 99 is displayed.
To set the configuration options for adaptive metrics, follow the steps below:
1. In the main menu of the LoadMaster WUI, select Rules & Checking > Check Parameters.
2. Type /load/LMperfagent.exe as the Adaptive URL and click Set URL.
The Adaptive Interval value determines how often the adaptive value is pulled. The Adaptive URL instructs the LoadMaster where to find the value. The 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\load\LMperfagent.exe then the Adaptive URL should be set to /load/LMperfagent.exe.
The Min Control Variable Value is a percentage that specifies the threshold below which the LoadMaster will switch to static weight-based scheduling, for example weighted round robin. The value is a percentage of the maximum load, but the maximum valid value of this field is 50. The default is 5. 5 is also the KEMP-recommended value for this field. If the Min Control Variable Value is set to 10, the weight will never be set below 10.
To configure the LoadMaster to use LMperfagent.exe, the Scheduling Method in the Virtual Service(s) must be set to resource based (adaptive). To set this, follow the steps below in the LoadMaster Web User Interface (WUI):
1. In the main menu of the WUI, select Virtual Services > View/Modify Services.
2. Click Modify on the relevant Virtual Service.
3. Expand the Standard Options section.
4. Select resource based (adaptive) as the Scheduling Method.
5. Repeat the above steps for any other Virtual Services as needed.
6. Expand the Real Servers section.
7. Click Add New.
8. Fill out the details as needed and click Add This Real Server.
After adding a Real Server that has LMperfagent installed (and selecting resource based as the Scheduling Method for the Virtual Service), the adaptive value is displayed in Statistics > Real Servers.
You can run the lmagent from command line or by navigating to the website and lmagent directory (http://LocalHost/load/lmperfagent.exe). From the command line, you can run it as the admin user, use the lmagent user, or run it in debug mode. This is useful for testing permissions and running it in verbose mode (refer to the Troubleshooting section for further information). Running it from a browser simulates the way the LoadMaster obtains the value. Therefore, the values should match regardless of what way you have accessed it.
The configuration file is located in C:\inetpub\wwwroot\load. It is either a .txt file or a .xls file (.txt by default). You can open either the .txt file in a text editor or the .xls file in a spreadsheet editor. In the file, each metric has its own line and each line consists of five different fields.
The five fields are described below:
- WEIGHT (% of 100): The weight that the specified metric has on the overall performance value reported.
- 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 would be 50, because 50% of the memory is utilized.
- DIRECTION: The direction column indicates if the value is an up or down value. A good example to illustrate the difference between an 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 would be a fully utilized system, so it would report 101.
If instead the metric reported memory utilized, a value of 2048 MB of RAM would mean that no RAM was being used, and the value reported would be 1. If the memory utilized shot up to 2048 MB, the value reported would be 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 would report 101.
- COUNTER: The metric itself. A list of available metrics can be found in the example configuration file. Additional information is available in the README file.
Some of the common problems occur due to issues with permissions. Try logging in with the lmagent user and try running the agent using the command line:
1. Navigate to the load folder.
2. Run LMperfagent.exe in verbose mode by typing LMperfagent.exe v.
If it runs when you are logged in as lmagent, permissions are OK.
Check the memberships of the lmagent user and verify that the access level is high enough. Ensure that the configuration file for the agent can be read by the lmagent user and is located in the load directory on the Real Server.
The normal weighted performance load value should be between 0 and 99. A value of 101 means that a Real Server is disabled.
A negative value means that a parameter is configured incorrectly. For example, by default the configuration file isn set with 2048 MB of memory. If your server has a greater value and more than 2048 MB of RAM is being used, a value of more than 100% is returned for memory used. If 2048 MB is set as the memory value and 4096 MB is in use, an adaptive value of -200 is displayed.
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 20 June 2018.