토요일, 2월 08, 2020

CMD - free 명령어를 이용한 메모리 사용률 확인 방법

메모리 사용률 확인

사용 환경에서 필요한 내용만 정리.

시스템 환경

OS : CentOS 7 3.10.0-957.el7.x86_64

실행 명령어

centos 6.x 버전 밑 버전에서 메모리 읽는 방식이 7에서 부터는 변경이 되었다.
(-/+ buffers/cache 부분이 사라졌다.)

메모리 사용량 (%) = 메모리used/(메모리used+메모리free)*100

  • 사용 예시
[root@localhost sw]# free -m
              total        used        free      shared  buff/cache   available
Mem:           7803         892        4686         263        2224        6277
Swap:          8064           0        8064

메모리 사용률 계산
$$Memusage=\frac{used}{total}*100
$$

sar -r 1 명령어를 통해서도 사용률 확인 가능 (%memused) 확인

  • 초 단위로 버퍼 캐쉬 영역 분리 해서 메모리 확인
[root@localhost sw]# free -mw -s 1
              total        used        free      shared     buffers       cache   available
Mem:           7803         900        4627         308           2        2273        6224
Swap:          8064           0        8064

              total        used        free      shared     buffers       cache   available
Mem:           7803         900        4627         308           2        2273        6224
Swap:          8064           0        8064

Parameters

Parameters
total 총 메모리 크기
used 사용중인 메모리 (free-buff/cache)
free 여유 메모리 (used-buff/cache)
shared tmpfs, ramfs등에 사용되는 공유 메모리
buffer/cache 커널 버퍼 / 페이지 캐시 slab 메모리
available swapping 없이 new ps에 할당 가능한 메모리 예상 크기

Related Posts:

  • CentOs hostname Change settingCentOs hostname Change settingTest Environment Test OS : CentOS 7.2 Test Version : commandshostnamectl set-hostname [new_hostname]ex) If you reconnec… Read More
  • CMD - free 명령어를 이용한 메모리 사용률 확인 방법메모리 사용률 확인사용 환경에서 필요한 내용만 정리.시스템 환경OS : CentOS 7 3.10.0-957.el7.x86_64실행 명령어centos 6.x 버전 밑 버전에서 메모리 읽는 방식이 7에서 부터는 변경이 되었다. (-/+ buffers/cache 부분이 사라… Read More
  • Linux a frequently used command 리눅스명령어 Linux a frequently used commandTest OS : RedHat 7.2, CentOs 7 수정된 config 파일 #n일 이상 된 xml 파일 찾기 find . -type f -name "*.xml" -mtime -7… Read More
  • CDM - chwon 명령어 사용법파일 소유자 및 그룹 변경실 사용 환경에서 필요한 내용만 정리.Test environmentOS : CentOS 7 3.10.0-957.el7.x86_64주요 내용A file's owner can be changed using the chown command.chown… Read More
  • CMD - which, readlink 명령어를 활용법리눅스에 설치 된 JAVA 경로 확인 방법사용 환경에서 필요한 내용만 정리.시스템 환경OS : CentOS 7 3.10.0-957.el7.x86_64 실행 명령어사용 명령어 which, readlinkwhich : 명령어의 경로를 확인하는 명령어 readlink : 심… Read More

0 Comments:

댓글 쓰기