Knowledge Base
Searching in : Article
ID: AR08M00858
Applies to: NoMachine Server
Added on: 2015-08-31
Last Update: 2022-08-10
Print this article

Limits on concurrent virtual desktops and concurrent connections explained

Since NoMachine v. 7.6.2,  number of virtual desktops and connections set globally or on a per-user basis are no longer limited by default to 20 and are unlimited, i.e. they are set to:
VirtualDesktopsLimit 0
VirtualDesktopsUserLimit 0
ConnectionsLimit 0
ConnectionsUserLimit 0

To set unlimited, set the key to 0 or comment it out by pre-pending a #, e.g.
#VirtualDesktopsLimit 100

However, number of virtual desktops depends on the license. For example, a NoMachine Workstation allows up to four concurrent virtual desktops, this overrides whichever other value set in the server configuration.


Limits on the number of virtual desktops and/or connections can be set in two ways: (i) in the server configuration or if the server supports profiles, (ii) via profile rules. It's advisable to not mix the two ways.

The value specified as limit cannot be higher than the maximum number of connections or virtual desktops allowed in the license file (server.lic and/or node.lic) in the 'Connections' and 'Virtual Desktops' field respectively.

The connections limit counter counts all types of connections (connections to physical desktop, virtual desktops, custom sessions, sessions which have been reconnected, sessions connected to other user's virtual desktop).

The virtual desktops limit counter counts only new virtual desktops and new custom sessions.

When the user connects, the connections limit counter is always increased, while the virtual desktops limit counter is increased only when the user creates a new virtual desktop or a new custom session.

The connections-limit counter is decreased when the user disconnects.

The virtual desktops limit counter is decreased only when the user terminates the virtual desktop or custom session.

 

LIMITS SET IN THE SERVER CONFIGURATION FILE

The configuration files, server.cfg and node.cfg are in:

/usr/NX/etc  on Linux,
C:\Program files (x86)\NoMachine\etc on 64bit Windows systems and C:\Program files\NoMachine\etc on 32bits machines
/Applications/NoMachine.app/Contents/Frameworks/etc/ on macOS

 

1. Limits on concurrent virtual desktops on the NoMachine server host

1.1 The number of concurrent virtual desktops allowed on the remote machine is ruled by the VirtualDesktopsLimit server configuration key:

VirtualDesktopsLimit 20

When this limit is exceeded, the server issues the following message whenever trying to connect:

Reached the maximum number of concurrent virtual sessions on this server

In this case uncomment and increase the value set for the VirtualDesktopsLimit key in the server.cfg configuration file (/usr/NX/etc/server.cfg) . Restarting NoMachine is not required.

 

1.2 Number of cuncurrent virtual desktops a single user can run is ruled by the VirtualDesktopsUserLimit key in the server configuration file:

VirtualDesktopsUserLimit 20

When this limit is exceeded logs report:

Virtual Session capacity: reached for user: <username>

Uncomment and increase the value set for the VirtualDesktopsUserLimit key in the server configuration file to allow each user run more concurrent virtual desktops. Restarting NoMachine is not required.

 

2. Limits on concurrent connections to the NoMachine server host

2.1 Concurrent connections (either to physical desktop and virtual desktops) are ruled by the ConnectionsLimit key in the server configuration file:

ConnectionsLimit 20

When this limit is exceeded, the server makes room automatically for a new connection according to the settings of the AutomaticDisconnection key in the server configuration.

By default the server requests authorization to the user already connected (User A) to terminate its connection and let the new user (User B) have its own. If user a doesn't reply on time (timeout is 20 seconds) the server terminates connection of User A and let User B connect. This corresponds to: 'AutomaticDisconnection 0'.

If the connected user is the same of the incoming user, the request is skipped and the first connection is terminated to let the new one start.

If the server is configured to not automatically disconnect the current user ('AutomaticDisconnection 2') and the connections limit is exceeded, logs report:

Reached the maximum number of concurrent sessions on this server

In this case uncomment and increase the value set for the ConnectionsLimit key to allow for more connections. Restarting NoMachine is not required.
 

2.2  Number of concurrent connections to the remote server host a single user can run is ruled by the ConnectionsUserLimit key in the server configuration file:

ConnectionsUserLimit 20

When this limit is exceeded logs report:

Server capacity: reached for user: <username>

Uncomment and increase the value set for the ConnectionsUserLimit key in the server configuration file to allow each user to run more concurrent connections. Restarting NoMachine is not required.

 

Note for multi-node environments

Custom values for ConnectionsLimit, ConnectionsUserLimit, VirtualDesktopsLimit and VirtualDesktopsUserLimit  can be set (i) on the server and will apply to the whole multi-node system or can be set (ii) on a specific node and will apply to this node only.

Custom limits can be set also on the main server and on each of the remote nodes.

The general rule is that more restrictive settings override the others.

For example:

1) The multi-node environment is made of one server and three nodes

If 'ConnectionsLimit 100' is set in server.cfg on the main server and 'ConnectionsLimit 50' is set in server.cfg of three nodes, the maximum number of global connections distributed among the three nodes is still 100 (and not 150  as allowed by the sum of each node setting).

2) The multi-node environment is made of one server and one node

If 'ConnectionsLimit 100' is set in server.cfg on the main server and 'ConnectionsLimit 50' is set in server.cfg of the remote node, the maximum number of connections on the node is 50 (and not 100). If another node is added to the system with 'ConnectionsLimit 50' set in its server.cfg, the maximum number of global connections distributed among the two nodes is 100 (as per-settings of the main server), but each node will allow maximum 50 connections.

 


 

LIMITS SET VIA PROFILE RULES (for servers supporting profiles)

Limits set on per-user basis
it's possible to specify limits on a per-user and per-group of users basis. Groups can be system groups of users or NoMachine groups:

nxserver --ruleadd --class session --type connections-limit --value <number> OPTIONS

nxserver --ruleadd --class session --type virtual-desktops-limit --value <number> OPTIONS

where OPTIONS can be any of the following options:
--user, USERNAME set the rule on a per-user basis (USERNAME). The rule will be applied to the specified user only.
--group GROUP, set the rule for the specified GROUP.
 

Limits for multi-node environments
To define the maximum number of virtual sessions allowed on the node, you can specify the --limit option when adding the node:

nxserver --nodeadd NODE --limit LIMIT

or by editing it later:

nxserver --nodeedit NODE:PORT --limit LIMIT

This value (LIMIT) is also used by the NoMachine custom script for weighted round-robin.

 

Otherwise you can define the maximum number of virtual desktops allowed on the given node by setting this rule:

nxserver --ruleadd --class node --type virtual-desktops-limit --value LIMIT --node NODE:PORT


To control the maximum number of concurrent connections allowed on the given node, use instead:

nxserver --ruleadd --class node --type connections-limit --value LIMIT --node NODE:PORT

 

The more restrictive limit always applies and overrides the others.
 

Other references

1) Server administrator's guides:
https://www.nomachine.com/all-documents

2) How to terminate NoMachine virtual desktops sessions automatically
https://www.nomachine.com/AR08M00854