SKALE Node Swap Limit Fix
Introduction
This guide provides instructions for SKALE validators to fix swap limit issues on their nodes. We need to enable swap limiting capability so sChain containers can use swap properly.
Background
Swap memory is limited by default if memory for the container is limited. For each sChain container, 2.6GB of RAM is allocated on the machine, which means an additional 2.6GB will be allocated for swap. For more details, refer to the Docker documentation on resource constraints.
Checking Current Setup (Optional)
You can check the current memory allocation for your sChain containers (if your node has sChains) using the following command:
A correct setup should look similar to this:
MemorySwap
should be x2 of Memory
value.
Identifying the Issue
The issue occurs when the swap limit capability is disabled in the kernel. To check if this is the case, run:
If you see the following line at the end of the output, it means the swap limiting capability is disabled:
Fixing the Swap Limit Issue
Follow these steps to enable swap limiting capability:
-
Log into the node as a user that you used to setup the node (user should have sudo privileges).
-
Make a backup of your node and move backup archive to another machine:
Check out node-cli backup docs for more details.
-
Turn off your SKALE Node:
Wait for the node to turn off gracefully.
-
Edit the
/etc/default/grub
file. Add or edit theGRUB_CMDLINE_LINUX
line to include the following key-value pairs: -
Update GRUB:
-
Reboot the machine:
-
After the machine has rebooted, turn your SKALE Node back on:
Replace
[ENV_FILEPATH]
with the path to your environment file (the same you used for node updates).For more details on this process, you can refer to this Unix Stack Exchange thread.
-
After the node is turned on, check if the swap limit is enabled:
No warning should be displayed.