I/O Performance
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
- Using
iotop
andiostat
Hardware considerations
- 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.
Disk contention
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.
I/O Monitoring
There are a number of tools that can be used to monitor the disk I/O performance. The most popular is atop
.
Other popular tools include:
iotop
iostat
Let's take a quick look at using iotop
and iostat
to monitor the disk I/O performance.
Using iotop
and iostat
To monitor the disk I/O performance, you can use the following command:
sudo iotop
To use an alternative tool, you can use the following command:
iostat -m