"리눅스 CPU 사용률 확인"의 두 판 사이의 차이

32번째 줄: 32번째 줄:
* [[sar]]
* [[sar]]
* [[CPU 부하량]](load average)
* [[CPU 부하량]](load average)
==주석==
<references/>
[[분류:리눅스]]
[[분류:리눅스]]
[[분류:CPU]]
[[분류:CPU]]

2012년 12월 18일 (화) 09:49 판

1 방법1: mpstat

명령어
mpstat | tail -1 | awk '{print 100-$11}'
실행예시
nsmap01:~ # mpstat | tail -1 | awk '{print 100-$11}'
7.83
→ CPU 사용률은 7.83 %이다.[1]

2 방법2: top

명령어
top -n 1 | grep -i cpu\(s\)| awk '{print $5}' | tr -d "%id," | awk '{printf("%f\n", 100-$1)}'
실행 예시
nsmap01:~ # top -n 1 | grep -i cpu\(s\)| awk '{print $5}' | tr -d "%id," | awk '{printf("%f\n", 100-$1)}'
7.800000
→ CPU 사용률은 7.8 %이다.[2]

3 같이 보기

4 주석

  1. mpstat은 소수점 둘째 자리까지 확인 가능.
  2. top은 소수점 첫째 자리까지 확인 가능.
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}