NoMachine Support

Your questions answered

Knowledge Base

Searching in: Feature Requests
Filter the search results
Target version:
Last update:
Searching in: Feature Requests
ID: FR10O03537
Added on:  2017-10-27
Last update: 2019-03-19
Priority: High
Products: NoMachine Server
Target: 6
Status:  Implemented
Load-balancing sessions on the remote nodes according to the lowest system load

A further method for load-balancing automatically virtual desktops among the available Linux nodes should permit to select the node with the lowest system load. System load will be calculated according to the algorithm defined in the /usr/NX/scripts/lb/ script set on the node. 

By default, this algorithm takes in account the CPU Run Queue normalized by CPUs/Cores and I/O Wait and applies the following calculation:

load = (procs_running / cpus) + procs_blocked

This calculation can be edited in the script and adapted to different situations.

Note that the nodes with available memory (free swap + RAM) lower than a threeshold defined internally (e.g. 300MB for virtual desktops in X11 vector graphics mode) will be moved at the end of the list of available nodes.


In order to apply this new method, set in the server.cfg file:

LoadBalancingAlgorithm system-load

and restart the NoMachine server:

sudo /etc/NX/nxserver --restart


New description of the LoadBalancingAlgorithm key:

# Specify the algorithm to be used for selecting the node. Accepted
# values are:
# round-robin:  the server applies a plain round-robin algorithm to
#               choose the node or a weighted round-robin algorithm
#               if weight has been specified for each node. This is
#               the default.
# custom:       the server uses the custom load-balancing algorithm
#               specified in the NodeSelectionScript key.
# load-average: the server chooses the node with the minimum load
#               average provided by the system.
# system-load:  the server selects the node with the lowest system
#               load calculated according to the algorithm specified
#               in the script set on the node.
#LoadBalancingAlgorithm round-robin