Introduction
Once your node is running and connected to the network, you can optimise it for better performance and more efficient use of system resources. Of course, these changes will depend on your hardware setup, the system resources available, and what kind of node you’re running: a full node or a validator node. What we’re presenting here is a guide based on the experience of the Radix engineers and DevOps. Your mileage, of course, may vary.
We’re going to change the system resource allocations by changing the parameters in the ulimit
configuration, but before we get going, let’s take a look at the configuration settings we’re interested in:
Parameter | Description | Setting |
---|---|---|
| The number of files the host OS can keep open at once. | 65536 |
| The number of processes the OS can run simultaneously. | 65536 |
| The maximum locked-in address space a particular user can allocate. Once allocated, the pages stay in physical memory, which speeds up operations on the ledger database. The | unlimited |
| The maximum locked-in address space that can allocated on the OS as a whole. This value can only be set by the | unlimited |
If you’re running other applications on the same server as your node (which is highly inadvisable) then setting
memlock (soft)
tounlimited
will severely impact the performance of the other applications.
These changes can be made manually, but the easiest way to do it is through the infinitely versatile babylonnode
script.
Prerequisites
Obviously, you’ll need to have the babylonnode
CLI installed before you optimise the node. It’s a good idea to download the babylonnode
script, even if you have already installed it; this will ensure you’re running the latest version.
For guidance on installing the babylonnode CLI, take a look at Installing the babylonnode CLI.
1. Set up the optimiser
Execute the following command:
babylonnode optimise-node
The script will now download the support files
Log out of the shell then log in again.
2. Run the optimiser
Once the optimiser has installed, and you’ve logged back into the shell, run the same command to carry out the optimisations:
babylonnode optimise-node
The script will now ask if you’d like to update the ulimit settings. Press Y to update the settings to match the ones described above.
The script will now ask if you’d like to change the swap space. We’re recommending a swap file size of 8 GB (regardless of node type), so enter 8G.
Log out of your session to update the settings, then log in again.
3. Check your settings
To check your settings, execute the following command:
ulimit -a
The resulting table should match the settings presented above.
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 30953
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 65536
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 65536
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
You can also check the swap size using this command:
swapon --show
which gives the swap size, along with the amount in use
NAME TYPE SIZE USED PRIO
/swapfile file 8G 25M -2
More information on using babylonnode
You can use babylonnode
to carry out a variety of administrative tasks.
For a full reference on the commands the babylonnode
CLI offers, please see the documentation on the CLI GitHub repository.
If you have any questions or run into problems, you can get support from the Radix team members and our fantastic community on our Discord server.