create cron job and ☕
The script can be used to debug and troubleshoot a performance issue. It'll log main performance metriks to text files which can be parsing later.
perf_log - creat and log output of top,ps,pmstat,vmstat and free
ps_ram - parsing ps_mem logs for finding RAM diff
ps_ram_classic - parsing ps logs for finding RAM diff
EXAMPLE:
example:
perf_log/2023-02-10/13# ls -sl
total 69
1 -rwxrwx--- 1 root vboxsf 204 Feb 10 13:28 28_free
4 -rwxrwx--- 1 root vboxsf 646 Feb 10 13:28 28_mpstat
4 -rwxrwx--- 1 root vboxsf 2991 Feb 10 13:28 28_ps
36 -rwxrwx--- 1 root vboxsf 35774 Feb 10 13:28 28_ps_classic
24 -rwxrwx--- 1 root vboxsf 22228 Feb 10 13:28 28_top
1 -rwxrwx--- 1 root vboxsf 244 Feb 10 13:28 28_vmstat
then you can add this script to crontab
example:
* * * * * root /opt/scripts/perf_log
To change the log path please change value of Dir in the perf_log file