侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

Load & Memory monitoring using SAR

2023-11-23 星期四 / 0 评论 / 0 点赞 / 43 阅读 / 2758 字

Is there any way to get my server’s load and memory usage history from commandline? Yes, it’s possib

Is there any way to get my server’s load and memory usage history from commandline?

Yes, it’s possible by using the commandline utility SAR. System Activity Reporter is abbreviated as SAR. It is an important tool to monitor server’s different important metrics at different points of time. Using SAR it will be possible to monitor the performance of various Linux subsystems (CPU, Memory, I/O..) in real time. If you had a problem with your server performance, you can check the resource usage history by using SAR utility. There are a lot of options are available with SAR. Here I’m explaining the usage of load average andmemory usage analysing steps.

 

sysstat - daemon 

SAR for load monitoring purpose

sar -q

The above command will report load averages at different times. (It fetch data from /var/log/sa(sysstat)/sa*, where sa* represent the date like sa10,sa11,sa12etc).

Examples

>> sar -q  

It simply list current day’s load averages starting from 12:00:00, with 10 minute interval.

>> sar -q 1 5

It list load averages 5 times from when we enter this with an interval of 1 sec.

>> sar -q -f /var/log/sa/sa23

Previous dates details are stored in the directory “/var/log/sa/”. The switch “f” along with the command SAR can fetch previous days details.

SAR for memory monitoring purpose

sar -r 

Report memory details.

Examples

>> sar -r 

It simply list current day’s memory usage averages starting from 12:00:00, with 10 minute interval.

>> sar -r 1 5

It list memory usage averages 5 times from when we enter this with an interval of 1 sec.

>> sar -r -f /var/log/sa/sa23

Fetch data from /var/log/sa/sa23.

That’s it!!

广告 广告

评论区