Linux sar(sysstat)
Configuration file:
/etc/default/sysstat
sysstat Service:
sudo service sysstat restart
One more thing to do, change the collection interval from every 10 minutes to every 2 minutes.
vi /etc/cron.d/sysstat
Change
5-55/10 * * * * root command -v debian-sa1
To
*/2 * * * * root command -v debian-sa1
----
Displays CPU usage for the 10day of the month from the sa10 file starting from 09 a.m
sar -u -f /var/log/sa/sa10 -s 09:00:00
Displays memory usage for the 10day of the month from the sa10 file starting from 09 a.m
sar -r -f /var/log/sa/sa10 -s 09:00:00
- kbmemfree : is the amount of free memory in kilobytes
- kbmemused : is the amount of used memory in kilobytes
- %memused : is the percentage of how much memory was being used
- kbbuffers : is the amount of buffer space used by the kernel in kilobytes
- kbcached : is the amount of cached space used by the kernel in kilobytes
- kbcommit : amount of memory in kilobytes needed for current workload. This is an estimate of how much RAM/swap is needed to guarantee that there never is out of memory.
- %commit : percentage of memory needed for current workload in relation to the total amount of memory (RAM+swap). This number may be greater than 100% because the kernel usually overcommits memory.
Displays Overall I/O Activities for the 10day of the month from the sa10 file starting from 09 a.m
sar -b -f /var/log/sa/sa10 -s 09:00:00
- tps : Transactions per second (this includes both read and write)
- rtps : Read transactions per second
- wtps : Write transactions per second
- bread/s : Bytes read per second
- bwrtn/s : Bytes written per second
Displays run queue and load average for the 10day of the month from the sa10 file starting from 09 a.m
sar -q -f /var/log/sa/sa10 -s 09:00:00
- runq-sz : The number of kernel threads in memory waiting for a CPU to run. Typically, this value should be less than 2. Consistently higher values mean that the system may be CPU-bound.
- plist-sz : Number of tasks in the task list
- ldavg-1 : Load avg past 1 minute
- ldavg-5 : Load avg past 5 minute
- ldavg-15: Load avg past 15 minute