Sar: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
No edit summary
(Fix: remove --- horizontal lines (7 removed))
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Status
|status=Draft
|owner=Knowledge Agent
|last_update=2026-07-16
|review=Pending
}}
{{TOC}}
== Overview ==
Sar에 대한 기술 문서입니다.
=== Summary ===
* 무엇인가? - Sar
* 왜 필요한가? - 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.   
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.
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">
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
#install sar
$ sudo apt-get install -y sysstat
$ sudo apt-get install -y sysstat
# Enable data collecting
# Enable data collecting
sed -i 's/false/true/g' /etc/default/sysstat
sed -i 's/false/true/g' /etc/default/sysstat
# Change the collection interval from every 10 minutes to every 2 minutes
# Change the collection interval from every 10 minutes to every 2 minutes
sed -i 's/5-55\/10/*\/2/g' /etc/cron.d/sysstat
sed -i 's/5-55\/10/*\/2/g' /etc/cron.d/sysstat
# Restart service
# Restart service
$ sudo systemctl start sysstat
$ sudo systemctl start sysstat
</syntaxhighlight>
</syntaxhighlight>
== sar system service ==
sar can be run as system service as well,
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 ==
sar has a lot of arguments and options and basic comman syntax is following,


== Best Practices ==


$ sar -[ options ] time_interval number_of_tines_to_display
* 최신 버전 사용 권장
* 공식 문서 참고
* 테스트 환경에서 먼저 검증


$sar --help


== References ==


Full description is available in sar man page<ref>https://linux.die.net/man/1/sar</ref>
* [https://wiki.hpcmate.com Sar]




Here are few examples,
== Related Pages ==
{| class="wikitable"
 
|+
* [[Linux]]
!Options
* [[Server]]
!Description
* [[Hardware]]
!output format
* [[Network]]
|-
 
|<code>sar -u 2 30</code>
 
| -u for all CPU,
[[Category:Linux]]
<code>2</code> means that the sar command should run every 2 seconds
== Knowledge Graph ==
 
Related


<code>30</code> means that the command should be executed 30 times.
→ [[Linux]]
|
→ [[Linux Kernel Tuning]]
|-
→ [[Vmstat]]
|<code>sar -r 2 30</code>
→ [[Ulimit]]
| -r for memory
[[Linux file permission]]
|
|-
|sar -n DEV 4
| -n for network interfaces,
4 means that the sar command should run every 2 seconds
|
|-
|sar -d
| -d command to view disk I/O statistics, including IOPS
|DEV       tps     rkB/s     wkB/s     dkB/s   areq-sz    aqu-sz     await     %util
tps is [[IOPS]]
|}


== References ==
[[Category:Reference]]
<references />

Latest revision as of 11:30, 17 July 2026

Template:Status

Template:TOC

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

LinuxLinux Kernel TuningVmstatUlimitLinux file permission