본문 바로가기
Server

[CentOS7] 메모리 실제 사용률 스크립트 확인

by 전재훈 2022. 4. 13.
반응형

실질 메모리 사용률

실질 메모리 사용량
캐시 영역을 제외한 메모리 사용량

 

공식

real_usage=usedtotal∗100(%)

계산 명령어

free | grep ^Mem | awk '{printf "actual_usage=%s, total=%s, actual_usage_ratio=%.2f%% \n", $3, $2, $3*100/$2}'

 

명목 메모리 사용률

명목 메모리 사용량
실질 메모리 사용량과 캐시 영역을 포함한 메모리 사용량을 더한 양

 

공식

usage=used+buff/cachetotal∗100(%)

계산 명령어

free | grep ^Mem | awk '{printf "nominal_usage=%s, total=%s, nominal_usage_ratio=%.2f%% \n", $3+$6, $2, ($3+$6)*100/$2}'

 

CentOS6 버전일 경우 아래 링크 참고 

https://intro0517.tistory.com/246

 

출처 : https://passwd.tistory.com/37

반응형

댓글