반응형
1. Cpu 사용량 확인하기
1) 확인하기 : top
%id가 붙은게 현재 사용가능한 퍼센트 이므로 100 – 99.3 = 0.7 이 현재 사용량이다
2) 사용률 보기 : top -b -n 1 | grep Cpu | awk '{print $5}' | tr -d "%id," | awk '{print 100-$1"%"}'
2. Memory 사용량 확인하기
1) 확인하기 : free –m
Mem은 메모리 사용량이고 Swap은 스왑메모리 사용량이다.
free –g : 기가단위로 확인
free -m : 메가단위로 확인
free –k : 키로단위로 확인
2) 사용량 확인하기 : free | grep Mem | awk '{print sprintf("%.2f%",$3/$2*100)}'
반응형
'리눅스 > centos' 카테고리의 다른 글
[centos]centos7 ifconfig(ip addr show) (0) | 2014.10.29 |
---|---|
[centos]centos7 설치 minimal (1) | 2014.10.24 |
[centos]열린포트 확인 (0) | 2014.10.23 |
[centos]nf_conntrack: table full, dropping packet (0) | 2014.04.17 |
[mysql]db백업 table백업 (0) | 2014.04.14 |