๐Ÿ“‚ System/Linux

[Linux] top ์‹ค์‹œ๊ฐ„ ์‹œ์Šคํ…œ ๋ชจ๋‹ˆํ„ฐ๋ง

dhyuck 2022. 1. 14. 22:15
๋ฐ˜์‘ํ˜•

provides a dynamic real-time view of a running system
It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel.

  • c : ์ƒ์„ธ ์ปค๋งจ๋“œ ๋˜๋Š” ํ”„๋กœ๊ทธ๋žจ ๋ณด๊ธฐ
  • o COMMAND={์ปค๋งจ๋“œ} : ์ปค๋งจ๋“œ๋กœ ํ•„ํ„ฐ๋ง
  • o USER={์œ ์ €๋„ค์ž„} : ์œ ์ €๋กœ ํ•„ํ„ฐ๋ง
  • d {๋”œ๋ ˆ์ด ํƒ€์ž„} : ๋”œ๋ ˆ์ด ํƒ€์ž„์„ ๋ณ€๊ฒฝํ•œ๋‹ค. ๊ธฐ๋ณธ์€ 3์ดˆ๋งˆ๋‹ค ๊ฐฑ์‹ 
  • k {pid} {์‹œ๊ทธ๋„ ๋„˜๋ฒ„} : kill-a-task
    • signal 15 : SIGTERM
    • signal 9 : SIGKILL
  • q : Quit
  • SHIFT + M : ๋ฉ”๋ชจ๋ฆฌ ๊ธฐ์ค€์œผ๋กœ ์ •๋ ฌ
  • SHIFT + P : CPU ๊ธฐ์ค€์œผ๋กœ ์ •๋ ฌ
  • SHIFT + T : ์‹œ๊ฐ„ ๊ธฐ์ค€์œผ๋กœ ์ •๋ ฌ

  • PID : ํ”„๋กœ์„ธ์Šค ์•„์ด๋””
  • USER : ์œ ์ €๋„ค์ž„
  • PR : ์Šค์ผ€์ค„๋ง ์šฐ์„ ์ˆœ์œ„
    • rt : real time(์‹ค์‹œ๊ฐ„) ์Šค์ผ€์ค„๋ง
    • ๊ฐ’์ด ๋†’์„์ˆ˜๋ก ์šฐ์„ ์ˆœ์œ„๊ฐ€ ๋†’๋‹ค
  • NI : Nice Value
    • ์Œ์ˆ˜์ด๋ฉด ์šฐ์„ ์ˆœ์œ„๊ฐ€ ๋†’๊ณ , ์–‘์ˆ˜์ด๋ฉด ์šฐ์„ ์ˆœ์œ„๊ฐ€ ๋‚ฎ๋‹ค.
    • 0์€ ๋””์ŠคํŒจ์น˜ ๊ฐ€๋Šฅ์„ฑ์„ ๊ฒฐ์ •ํ• ๋•Œ ์šฐ์„ ์ˆœ์œ„๊ฐ€ ์กฐ์ •๋˜์ง€ ์•Š์Œ์„ ์˜๋ฏธ
  • VIRT : ๊ฐ€์ƒ ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰(Virtual Memory Size)
    • KiB ๋‹จ์œ„
    • task๊ฐ€ ์‚ฌ์šฉํ•˜๋Š” ๊ฐ€์ƒ ๋ฉ”๋ชจ๋ฆฌ์˜ ์ด ์‚ฌ์šฉ๋Ÿ‰
    • ๊ฐ€์ƒ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ๋ฐ˜๋“œ์‹œ ๋ฉ”๋ชจ๋ฆฌ์ผ ํ•„์š”๋Š” ์—†์Œ
  • RES : ์‹ค์ œ ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰(Resident Memory Size)
    • KiB ๋‹จ์œ„
    • task๊ฐ€ ํ˜„์žฌ ์‚ฌ์šฉํ•˜๋Š” (์Šค์™‘๋˜์ง€ ์•Š์€) ๋ฌผ๋ฆฌ์  ๋ฉ”๋ชจ๋ฆฌ
    • ์‹ค์ œ ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰
  • SHR : ๊ณต์œ  ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ๋Ÿ‰(Shared Memory Size)
    • KiB๋‹จ์œ„
    • ๋‹ค๋ฅธ ํ”„๋กœ์„ธ์Šค์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” RES์˜ ํ•˜์œ„์ง‘ํ•ฉ
  • S : ํ”„๋กœ์„ธ์Šค ์ƒํƒœ(Process Status)
    • D = uninterruptible sleep
    • I = idle
    • R = running
    • S = sleeping
    • T = stopped by job control signal
    • t = stopped by debugger during trace
    • Z = zombie
๋ฐ˜์‘ํ˜•