Run sar to monitor Memory | Linux
Summary
One web service was not working well. The Web Developer reported that might be because of not enough memory. So needed a monitor to collect & save the log to ensure the Question.
Content
# sar: collect, report, or save system activity information
# tee: read from standard input and write to standard output and files
#
# Report per each 5s & Write the log
If "Cannot open /var/log/sysstat/sa02: No such file or directory"
Update
One web service was not working well. The Web Developer reported that might be because of not enough memory. So needed a monitor to collect & save the log to ensure the Question.
Content
$ sudo yum install sysstat
# sar: collect, report, or save system activity information
# tee: read from standard input and write to standard output and files
#
# Report per each 5s & Write the log
$ sudo sar -r 5 | tee sar.log
If "Cannot open /var/log/sysstat/sa02: No such file or directory"
$ sudo vim /etc/default/sysstat
#
# Default settings for /etc/init.d/sysstat, /etc/cron.d/sysstat
# and /etc/cron.daily/sysstat files
#
# Should sadc collect system activity informations? Valid values
# are "true" and "false". Please do not put other values, they
# will be overwritten by debconf!
ENABLED="true"
#
# Default settings for /etc/init.d/sysstat, /etc/cron.d/sysstat
# and /etc/cron.daily/sysstat files
#
# Should sadc collect system activity informations? Valid values
# are "true" and "false". Please do not put other values, they
# will be overwritten by debconf!
ENABLED="true"
$ sudo service sysstat restart
Update