Blockchain nodes tend to be I/O bound. So in terms of performance, the disk/volume speed is likely to be the most important factor for a Pocket node.
In this section, we'll discuss the following topics related to disk/volume performance:
- Hardware considerations
- Open file descriptors
- Disk contention
- I/O Monitoring
- Use fast SSDs drives, preferably NVMe M.2 (Gen4).
- Consider using a RAID controller
Open file descriptors
By default, Ubuntu sets limits on the number of open files a user is allowed to have. Pocket nodes will have a lot of files open at times. So we'll need to increase the default ulimit for the user account pocket runs under.
When multiple processes are accessing the same disk, the disk will have to wait for the other processes to finish before it can continue. This is referred to as disk contention and it can cause a significant delay in the I/O performance on both the disk and CPU. The best way to limit this is to put the Pocket data directory on a separate drive/volume from the operating system.
There are a number of tools that can be used to monitor the disk I/O performance. The most popular is
Other popular tools include:
Let's take a quick look at using
iostat to monitor the disk I/O performance.
To monitor the disk I/O performance, you can use the following command:
To use an alternative tool, you can use the following command: