Management Console is a highly loaded application serving hundreds of Agents and tens of Jobs. For the purposes of optimisation and stability, the MC process is split into several sub-processes: main thread and a number of workers. Workers perform all the communication between the Agents and MC: send out jobs' configuration, collect statistics data and events, update database entries, etc; while the main thread accumulates the data from workers.
By default MC has one main thread and two workers. Usually it's enough for most use cases, however, in some cases it's advisable to increase the number of workers.
How do I know if I need to increase the number of workers?
It's worth checking before updating to MC v3.x. There are common recommendations for MC v 3.0.0 and newer on the number of workers it shall have, depending on the number of connected Agents:
500 - 1000 Agents: 2 worker threads in total (default)
1001 - 2000 Agents: 3 worker threads in total
2001 - 4000 Agents: 4 worker threads.
Also, a side-symptom would be general slowness of MC to respond.
To check how many workers you currently have:
on Windows open Task manager and see node.js processes.
on Linux run command ps aux | grep node
On the screenshots below, one is the main thread, the two others are workers.
What would be the impact and what shall I do before increasing the workers?
First of all MC shall work faster and be more stable.
A side effect would be increase in CPU cores usage. Basically MC consumes 2 cores (1 for main thread, 1 for workers). MC will take one more core for each extra worker plus it's a good practice to have one more reserve core.
Another side effect would be increase in RAM consumption. By default MC requires 3GB for main thread, 1 GB for worker thread. It is recommended to increase main process RAM allocation by +1GB for each extra worker (see instructions below).
How to increase the number of workers?
Increasing the workers implies editing the MC configuration file.
1. Stop Management Console process. Make sure it's correct termination of the process, do not force kill it.
2. Open the MC config file. On Windows C:\ProgramData\Resilio\Connect Server\resilio-connect-server.conf
, on Linux ${resilio_connect_server_dir}/var/resilio-connect-server.conf
3. Add the following lines to the config on top level (or edit them if they do exist already). Be sure to keep json format of the file!
"agentWorkers":
{"number": 1,
"maxMemory": 1024
}
where number - is the total number of new workers to spawn
maxMemory - amount of RAM allowed for each thread to use.
4. Start the MC and check the number of workers.
How to increase amount of RAM allowed for MC main process?
1. Stop the MC server
2. Open regedit, navigate to HKLM\SYSTEM\CurrentControlSet\Services\resilio-connect-server
, edit ImagePath
key, adjust the value of max_old_space_size (megabytes)
Starting with Resilio Connect 3.8.2, parameter CUSTOM_MEMORY_LIMIT= must be used instead.
"C:\Program Files\Resilio Connect Server\node.exe" "--max_old_space_size=3072" "--no-deprecation" "C:\Program Files\Resilio Connect Server\server\server.js" "run"
3. Close regedit
4. Start the server
1. Stop the MC server
2. Edit srvctrl shellscript, adjust the value of max_old_space_size (megabytes)
Starting with Resilio Connect 3.8.2, parameter CUSTOM_MEMORY_LIMIT= must be used instead.
#!/bin/sh DIST_PATH=$(dirname $0) SERVER_DIST_PATH=$DIST_PATH/server export PATH=$DIST_PATH/nodejs/bin:$PATH export NODE_ENV=production node --max_old_space_size=3072 "$SERVER_DIST_PATH/server.js" $*
3. Save it
4. Start the server