Sar: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
(Created page with "Monitoring server resources is a crucial part of identifying any bottlenecks and possible issues on your server. The <code>sar</code> command allows you to capture the utilization of your resources like RAM, CPU, Disk I/O and etc on Ubuntu, sar can be installed by $sudo apt install sysstat == sar system service == sar can be run as system service # sudo systemctl start sysstat # sudo systemctl enable sysstat # This will add the required cron jobs so that the system...")
 
({{Status}}/{{TOC}} 템플릿 제거)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Monitoring server resources is a crucial part of identifying any bottlenecks and possible issues on your server.  The <code>sar</code> command allows you to capture the utilization of your resources like RAM, CPU, Disk I/O and etc
== Overview ==


on Ubuntu, sar can be installed by
Sar에 대한 기술 문서입니다.


$sudo apt install sysstat
=== Summary ===


== sar system service ==
* 무엇인가? - Sar
sar can be run as system service
* 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
* 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시


== Purpose ==
이 문서가 존재하는 이유
* Goal: Sar에 대한 기술 정보 제공
* Scope: Sar의 개념, 사용법, 설정
* Non-goals: 다른 주제로의 확장
== Key Concepts ==
{| class="wikitable"
! Concept
! Description
! Related
|-
| Sar
| HPC/서버 환경에서 중요한 기술 개념
| [[Linux]], [[Server]]
|}
== Detailed Explanation ==
Monitoring server resources is a crucial part of identifying any bottlenecks and possible issues on your server. 
sar stands for “System Activity Reporter” and provides a wide range of metrics related to system usage, including CPU utilization, memory usage, disk I/O, network activity.
on Ubuntu, sar can be installed by following<ref>https://stackoverflow.com/questions/45725414/cannot-open-var-log-sysstat-sa16-please-check-if-data-collecting-is-enabled-in</ref> <syntaxhighlight lang="bash">
#install sar
$ sudo apt-get install -y sysstat
# Enable data collecting
sed -i 's/false/true/g' /etc/default/sysstat
# Change the collection interval from every 10 minutes to every 2 minutes
sed -i 's/5-55\/10/*\/2/g' /etc/cron.d/sysstat
# Restart service
$ sudo systemctl start sysstat
</syntaxhighlight>
sar can be run as system service as well,
# sudo systemctl start sysstat
# sudo systemctl start sysstat
# sudo systemctl enable sysstat
# sudo systemctl enable sysstat
# This will add the required cron jobs so that the system data is collected accordingly. The cron jobs will be added at cat /etc/cron.d/sysstat
# This will add the required cron jobs so that the system data is collected accordingly. The cron jobs will be added at cat /etc/cron.d/sysstat
Using systemd service, we can easily set '''sar''' up to run automatically on your system, store its collected stats in daily files.
On Ubuntu, sar log files will be stored in '''/var/log/sysstat folder.'''
To view all sar reports,
$ sar -f /var/log/sysstat/sa07


== Command and options ==
== Best Practices ==
sar has a lot of arguments and options,
 
{| class="wikitable"
* 최신 버전 사용 권장
|+
* 공식 문서 참고
!Options
* 테스트 환경에서 먼저 검증
!Description
|-
|<code>sar -u 2 30</code>
| -u for all CPU,
<code>2</code> means that the sar command should run every 2 seconds
<code>30</code> means that the command should be executed 30 times.
|-
|<code>sar -r 2 30</code>
| -r for memory
|-
|sar -n DEV 4
| -n for network interfaces,
4 means that the sar command should run every 2 seconds
|}


== References ==
== References ==
<references />
 
* [https://wiki.hpcmate.com Sar]
 
== Related Pages ==
 
* [[Linux]]
* [[Server]]
* [[Hardware]]
* [[Network]]
 
[[Category:Linux]]
== Knowledge Graph ==
 
Related
 
→ [[Linux]]
→ [[Linux Kernel Tuning]]
→ [[Vmstat]]
→ [[Ulimit]]
→ [[Linux file permission]]
 
[[Category:Reference]]

Latest revision as of 13:25, 2 October 2026

Overview

Sar에 대한 기술 문서입니다.

Summary

  • 무엇인가? - Sar
  • 왜 필요한가? - HPC 및 서버 환경에서 필수 개념
  • 언제 사용하는가? - 서버 구성, 성능 튜닝, 문제 해결 시

Purpose

이 문서가 존재하는 이유

  • Goal: Sar에 대한 기술 정보 제공
  • Scope: Sar의 개념, 사용법, 설정
  • Non-goals: 다른 주제로의 확장

Key Concepts

Concept Description Related
Sar HPC/서버 환경에서 중요한 기술 개념 Linux, Server

Detailed Explanation

Monitoring server resources is a crucial part of identifying any bottlenecks and possible issues on your server. sar stands for “System Activity Reporter” and provides a wide range of metrics related to system usage, including CPU utilization, memory usage, disk I/O, network activity.

on Ubuntu, sar can be installed by following[1]

#install sar
$ sudo apt-get install -y sysstat
# Enable data collecting
sed -i 's/false/true/g' /etc/default/sysstat
# Change the collection interval from every 10 minutes to every 2 minutes
sed -i 's/5-55\/10/*\/2/g' /etc/cron.d/sysstat
# Restart service
$ sudo systemctl start sysstat

sar can be run as system service as well,

  1. sudo systemctl start sysstat
  2. sudo systemctl enable sysstat
  3. This will add the required cron jobs so that the system data is collected accordingly. The cron jobs will be added at cat /etc/cron.d/sysstat

Using systemd service, we can easily set sar up to run automatically on your system, store its collected stats in daily files. On Ubuntu, sar log files will be stored in /var/log/sysstat folder. To view all sar reports, $ sar -f /var/log/sysstat/sa07

Best Practices

  • 최신 버전 사용 권장
  • 공식 문서 참고
  • 테스트 환경에서 먼저 검증

References

Related Pages

Knowledge Graph

Related

→ Linux → Linux Kernel Tuning → Vmstat → Ulimit → Linux file permission