Performance Monitoring
Monitoring TON server performance
Tools like htop
, iotop
, iftop
, dstat
, nmon
and others are good for measuring real-time performance, but they lack functionalities when it comes to troubleshooting past performance.
This guide recommends and explains how to use the Linux sar (System Activity Report) utility for TON server performance monitoring.
This guideline helps to identify if your server experiences any resource shortage, not if validator-engine performs badly.
Installation
SAR Installation
sudo apt-get install sysstat
Enable automatic statistics gathering
sudo sed -i 's/false/true/g' /etc/default/sysstat
Enable the service
sudo systemctl enable sysstat sysstat-collect.timer sysstat-summary.timer
Start the service
sudo systemctl start sysstat sysstat-collect.timer sysstat-summary.timer
Usage
By default sar gathers statistics every 10 minutes and shows statistics for the current day, starting at midnight. You can check it by running sar without parameters:
sar
If you want to see statistics of the previous day or two days before, pass the number as an option:
sar -1 # previous day
sar -2 # two days ago
For the exact date, you should use the f option to point to the sa file of a given day within a month. Thus, for the September 23rd it would be:
sar -f /var/log/sysstat/sa23
What sar reports to run and how to read them in order to identify performance issues?
Below is the list of sar commands that can be used to gather different system statistics. You can supplement them with the above options to quickly get the reports for the required date.
Memory report
sar -rh