Balancing the Load
Load balancing allows you to get the most out of your servers by evenly distributing the load across systems. Redwood Server by default uses process count of process servers to distribute the load; this is not very efficient when processes have discrepancies in resource utilization. Resource-hungry processes count as much as lightweight processes. Redwood Server offers several load balancing strategies that can be used on their own or in combination.
Generic Load Balancing using Queues
This type of load balancing can be used for any type of workload and is typically used to prevent a weak system from slowing down or offloading some workload onto a server that has another more important role in another queue. You set the execution size on QueueProviders, several process servers serve the queue. By default, if more than one process server is serving the queue, Redwood Server will send processes to the process server with the smallest number of processes in status Running. You can influence this by setting an execution size on the QueueProvider of a process server. Redwood Server will ignore the process server while the number of its running processes equals the QueueProvider's execution size. You can include processes in status Waiting in your execution size, however, these typically do not consume any resources on the remote system.
Using Load Factors
You use load factors to specify custom metrics for evaluating the load of a process server.
- Multiplier - the relative weight of a specific load factor
- Threshold - the maximum value allowed for this load factor, when this is reached, the process server is set to Overloaded
- Monitor Value - the unit to use (CPU time, Page rate, process server check value, jmonitor value)
- Load Threshold - maximum allowed value of the sum of all load factors (multiplier * Monitor Value), when this is reached, the process server goes to status Overloaded
note
Load Threshold is process server-specific not load factor-specific; there is only one Load Threshold per process server. On process servers with one load factor only, Load Threshold should be set to the same or higher value as Threshold; it is only used when you want to take the combined effects of multiple load factors into account.
note
The Threshold and Load Threshold values must take the Multiplier values into account.
OS Metric Load Balancing using MonitorValues
For load balancing OS processes across platform process servers there are several options:
- process count load balancing - is the default option if no load factors are defined for the process servers. The system sends new processes to the process server with the least amount of running processes.
- OS metric load balancing - uses near real-time monitoring data from the platform agents to decide where to run the process.
- jmonitor load balancing - uses near real-time monitoring data generated by jmonitor.
Process Count
The default load balancing technique uses concurrent processes as the metric for balancing the load and is enabled by default.
The Load
and LoadThreshold
monitor values for the process server have the following values:
/System/Process Server/${PSName}/Performance/Load
- The number of processes the process server is currently processing./System/Process Server/${PSName}/Performance/LoadThreshold
- By default the maximum number of processes allowed to run simultaneously.
OS Metric
This type of load balancing requires a platform agent on each server and is typically used for platform agent workload. This load balancing uses load factors and a threshold for each process server. Two commonly used load factors are CPU usage ( CPUBusy
) and page rate ( PageRate
, the rate at which pages are sent to/retrieved from the swap area), however, you create process server checks to create your own criteria as well.
The Load
and LoadThreshold
monitor values for the process server have the following values:
/System/ProcessServer/${process_server}/Performance/Load
- Representation of the load factors as configured/Performance//System/ProcessServer/${process_server}/Performance/LoadThreshold
- Maximum load specified on the load factor tab/Performance/
Example 1
Two process servers accept processes that require a specific resource, server prd5.example.com
(process server MSLN_UNIXS5) is more powerful than prd7.example.com
(process server MSLN_UNIXS7) so you want to run 1.5 times more processes on pr5.example.com
. The prd7.example.com
process server should be maxed out at 50
concurrent processes, likewise, prd5.example.com
will be maxed out at 75
concurrent processes.
You specify the following load factors on the process servers:
process server | Multiplier | Threshold | Monitor Value | Load Threshold |
---|---|---|---|---|
prd5.example.com | 2 | 150 | /System/Process Server/MSLN_UNIXS5/Performance/Load | 150 |
prd7.example.com | 3 | 150 | /System/Process Server/MSLN_UNIXS7/Performance/Load | 150 |
Example 2
The same situation as the example above, however, the CPU utilisation also needs to be taken into account. The CPU utilization should not be allowed to go above 90%. A process uses a maximum of 5% CPU time.
process server | Multiplier | Threshold | Monitor Value | Load Threshold |
---|---|---|---|---|
prd5.example.com | 2 | 150 | /System/ProcessServer/MSLN_UNIXS5/Performance/Load | 235 |
prd5.example.com | 1 | 90 | /System/ProcessServer/MSLN_UNIXS5/Performance/CPUBusy | 235 |
prd7.example.com | 3 | 150 | /System/ProcessServer/MSLN_UNIXS7/Performance/Load | 235 |
prd7.example.com | 1 | 90 | /System/ProcessServer/MSLN_UNIXS7/Performance/CPUBusy | 235 |
note
The Load Threshold will only be reached when the sum of Load
and CPUBusy
monitor node values for one process server reach 235
.
Example 3
You have two process servers of which one is used for other workload as well. Server prd1.example.com
is a powerful system that is used by multiple applications compared to prd3.example.com
which has been added to the pool to relieve prd1.example.com
. You do not want to assign processes to process server prd1.example.com
when its CPU usage reaches 80%
and you want to have a ratio of 1.5:1
between the two.
You configure the following load factors:
Server | Multiplier | Threshold | MonitorValue | Load Threshold |
---|---|---|---|---|
prd1.example.com | 3 | 240 | /System/ProcessServer/MSLN_UNIXS1/Performance/CPUBusy | |
prd3.example.com | 2 | 200 | /System/ProcessServer/MSLN_UNIXS3/Performance/CPUBusy |
This means that 1% CPU usage is worth 3 units on prd1.example.com
and only 2 units on prd3.example.com
. In theory, with processes using the same amount of resources, prd3.example.com
will peak sooner than prd1.example.com
. As soon as the CPU usage on pr1.example.com
reaches 80%
no new processes will be dispatched to it.
jmonitor
The jmonitor command line program is used to store monitoring values in the Redwood Server monitor tree. Although you are free to use any path, it is highly recommended to store the values under /System/ProcessServer/${process_server}/Custom/
; you can create child nodes there to group specific values.