ROKO

[Linux] htop 본문

Develop

[Linux] htop

RO_KO 2023. 2. 9. 11:38
728x90

htop : Hiaham Table Of Process

2004년 Hiaham이 만든 프로세스 목록으로 프로세스의 목록 및 자원 사용량을 확인 할 수 있다.

프로세스의 사용량에 따라 나열된다.

 

CPU Status

 상단에 1~32 까지의 프로세스가 각 CPU 코어를 프로세스가 점유하고 있는 비율을 나타낸다. 각 Bar는 해당 코어의 사용된 % 를 표현한다.

 각 core 마다 색이 들어간 파이프(" | ") 가 나타나는데요.

 각 색이 의미하는것은 다음과 같습니다:

 

  • 파랑: low-priority
  • 녹색: normal
  • 빨강: kernel
  • 하늘: virtualiz

Mem / Swp

 CPU 밑에는 Memory 과 Swap 으로 메모리와 스왑 사용량이 표현되어 있다.

 메모리와 스왑은 전체 메모리의 사용된 메모리의 양을 표현한다.

Memory

  • 초록: Used
  • 파랑 : Buffer
  • 노랑 : cache

Swap

  • 빨강: Used

Load Average

 세가지 형식으로 1분, 5분, 15분 평균 수치를 표시한다.

 

각 필드의 최대치는 CPU 코어 갯수가 최대치로 싱글 코어 : 1.0, 쿼드코어 : 4.0이 CPU 전체 부하율이 100%라는 뜻이다. 이 때 최대치를 넘을 수 있는데, 이는 불특정 프로세스가 CPU를 점유하기 위해 대기 중이라는 뜻이다.

 

 

Process info

  • PID: 프로세스 식별자(ID)
  • USER: 프로세스의 소유자
  • PR: 프로세스의 우선 순위
  • NI: 우선순위에 영향을 주는 프로세스의 nice 값
  • VIRT: 프로세스가 사용 중인 가상 메모리 양
  • RES: 프로세스가 사용 중인 물리 RAM 의 양 (단위: kb)
  • SHR: 프로세스가 사용 중인 공유 메모리 양
  • S: 프로세스의 현재 상태.
    • R: the process is currently running or on a run queue waiting to run.
    • S: the process is in interruptible sleep (waiting for an event or condition to happen).
    • D: the process is in uninterruptible sleep (cannot be woken up from sleep).
    • Z: the process is defunct (a.k.a. “zombie”). Terminated but not repeated by its parent.
    • T: the process is stopped by the job control signal.
    • t: the process is stopped by the debugger during the tracing.
    • X: the process is dead. You will probably never see this one.
  • %CPU: 프로세스가 프로세서를 사용한 시간의 백분률
  • %MEM: 프로세스가 사용 중인 물리 RAM의 백분률
  • TIME+: 프로세스가 Core를 사용한 시간
  • COMMAND: 프로세스 시작에 사용한 명령

 

nice 값은 프로세스마다 부여된 우선순위 값으로 -20이 가장 높은 우선 순위이며, +19는 가장 낮은 우선 순위를 표현한다.

Menu

F1 Help htop 의 버전, License 정보, CPU/Core 와 Memory, Swap Bar 의 각 색상에 대한 설명. 그리고 각 단축키에 할당된 기능들을 설명.
F2 Setup 설정 화면
F3 Search 특정 프로세스를 검색할 수 있는 command bar를 화면에 출력. (VIM 하고 유사)
F4 Filter 걸러낼 명령어를 입력할 수 있는 기능
F5 Tree/Sorted + 를 특정 프로세스에서 입력하면 해당 프로세스가 열고 있는 파일의 스냅샷 출력
F6 SortBy/Collap 좌측에 정렬하고 싶은 필드가 노출
F7 Nice - 프로세스의 우선순위를 높임
F8 Nice + 프로세스의 우선순위를 낮춤
F9 Kill 특정 프로세스 종료
F10 Quit htop을 종료

추천 참고자료

https://htop.dev

 

htop - an interactive process viewer

htop - an interactive process viewer This is htop, a cross-platform interactive process viewer. It is a text-mode application (for console or X terminals) and requires ncurses. Latest release. What's new in htop Please check out the changelog for details a

htop.dev

https://monovm.com/blog/what-is-htop-and-what-does-it-do/

 

What is htop and What Does It Do? [htop Command]

Want to have a better Unix system monitor? We recommend the use of htop command. What is htop? How to understand its output?

monovm.com

 

728x90
Comments