Running a Stellar validator will not only allow you to directly communicate with the Stellar network, but also help secure the network and validate transactions.
I've been running nodes and witnesses for various chains and want to share a few tips to becoming a more effective admin as you run your node.
This guide is not meant to help you install or get running. I highly recommend reading the docs on Github https://github.com/stellar/docker-stellar-core-horizon. There is no point to re-iterate which has already been out-lined well.
Validator Performance Tips
1. Autorun
Use supervisor to auto run the validator node on restart of the server:
Install supervisor
sudo apt-get install supervisor
sudo systemctl enable supervisor
sudo service supervisor restart
If you need to stop or start stellar-core, use:
sudo supervisorctl stop stellar-core
sudo supervisorctl start stellar-core
To check the status, use:
sudo supervisorctl status
2. Shared Memory Improvements (Linux tweaks)
Stellar-Core's amount of resources needed are tied well with activity, but If you have issues with disk I/O writing, you might want to switch to RAM or VRAM swap for better performance of the shared memory file and writing.
To get around those memory issues, the best practice (IMHO) is to keep the "shared file" data in memory. The second best is to use the swapping system provided by the OS which has better performance than storing that data on disk directly (by default).
3. Tune Up Your TCP
Tuning the protocol helps to enhance network outturn for connection-hungry applications. Larger Linux protocol
sizes are suggested for communications across wide-area networks with giant information measure and long delay characteristics – so as to enhance through-put on transfer rates. The Linux protocol size determines what bottleneck that could be causing a host/transmit to a receiving host, while not receiving acknowledgment of information transfer.
The default maximum Linux TCP buffer sizes are way too small. TCP memory is calculated automatically based on system memory - you can find the actual values by typing the following commands:
$ cat /proc/sys/net/ipv4/tcp_mem
Set maximum number of packets, queued on the INPUT side, when the interface receives packets faster than kernel can process them.
# echo 'net.core.netdev_max_backlog = 5000' >> /etc/sysctl.conf
Now reload the changes:
# sysctl -p
Applying these performance tips will be helpful for running your Stellar node server at it's highest capacity.
Happy Validating!
-- Luminer