Part 3a - Adding swap and Benchmark
- It is recommended to add swap to ensure (1) stable running of the zend daemon (and Side Chain Applications for Super Nodes) (2) challenge times that meet the criteria (Super Node:100 seconds)
- It is generally good practice to allocate as much swap as your configuration has physical RAM
Description | Command | |
---|---|---|
1 | Check your current memory and swap space configuration and availability NOTE: Under the "total" column, you will see the total system memory allocation needed to configure the swap for step 2 | free -h Get a list of swapfile names and paths for your system sudo swapon -s Turn off and remove the swap file if one already exists (change /swapfile as necessary to the path and name of your swapfile) sudo swapoff /swapfile sudo rm /swapfile |
2 | Allocate the swapfile, changing the command as necessary NOTE: A Super Node with 8GB RAM, may add a 8GB swap file (change 2G on the right to 8G) | Don't enter this entry without first changing the value as instructed in the description column sudo fallocate -l 2G /swapfile |
3 | Set permissions on the swapfile | sudo chmod 600 /swapfile |
4 | Format the file as swap space | sudo mkswap /swapfile |
5 | Activate swap | sudo swapon /swapfile |
6 | Validate swap is activated using this command, the output should return a row for 'Swap:' as shown in the example output; with the value in the 'total column matching the allocated amount of swap from step 1 | free -h This is an example of a system with 2GB of RAM, 2GB of swap was set in step 2 Example Output zenops@node01:~$ free -h |
7 | Edit the /etc/sysctl.conf file to specify the 'swappiness' behaviour of your node Edit the /etc/fstab file, specifying that swap should be mounted at boot | echo "vm.swappiness=10" | sudo tee -a /etc/sysctl.conf echo "/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab |
8 | Activate the updated configuration (without rebooting) | sudo sysctl -p |