Understanding the Top command on Linux

Article by AlexioBash published on his website about ArchLinux in italian.

Know what is happening in “real time” on your systems is in my opinion the basis to use and optimize your OS. On ArchLinux or better on GNU/Linux in general thetopcommand can help us, this is a very useful system monitor that is really easy to use, and that can also allows us to understand why our OS suffers and which process use most resources. The command to be run on theterminalis:

And we’ll get a screen similar to the one on the right:

Let’s see now every single row of this output to explain all the information found within the screen.

1° Row — top

This first line indicates in order:

  • current time (11:37:19)
  • uptime of the machine (up 1 day, 1:25)
  • users sessions logged in (3 users)
  • average load on the system (load average: 0.02, 0.12, 0.07) the 3 values refer to the last minute, five minutes and 15 minutes.

2° Row – task

The second row gives the following information:

  • Processes running in totals (73 total)
  • Processes running (2 running)
  • Processes sleeping (71 sleeping)
  • Processes stopped (0 stopped)
  • Processes waiting to be stoppati from the parent process (0 zombie)

3° Row – cpu

The third line indicates how the cpu is used. If you sum up all the percentages the total will be 100% of the cpu. Let’s see what these values indicate in order:

  • Percentage of the CPU for user processes (0.3%us)
  • Percentage of the CPU for system processes (0.0%sy)
  • Percentage of the CPU processes with priority upgrade nice (0.0%ni)
  • Percentage of the CPU not used (99,4%id)
  • Percentage of the CPU processes waiting for I/O operations(0.0%wa)
  • Percentage of the CPU serving hardware interrupts (0.3%hi— Hardware IRQ
  • Percentage of the CPU serving software interrupts (0.0%si— Software Interrupts
  • The amount of CPU ‘stolen’ from this virtual machine by the hypervisor for other tasks (such as running another virtual machine) this will be 0 on desktop and server without Virtual machine. (0.0%st— Steal Time)

4° and 5° Rows – memory usage

The fourth and fifth rows respectively indicate the use of physical memory (RAM) and swap. In this order: Total memory in use, free, buffers cached. On this topic you can also read the followingarticle

Following Rows — Processes list

And as last thing ordered by CPU usage (as default) there are the processes currently in use. Let’s see what information we can get in the different columns:

  • PID – l’ID of the process(4522)
  • USER – The user that is the owner of the process (root)
  • PR – priority of the process (15)
  • NI – The “NICE” value of the process (0)
  • VIRT – virtual memory used by the process (132m)
  • RES – physical memory used from the process (14m)
  • SHR – shared memory of the process (3204)
  • S – indicates the status of the process: S=sleep R=running Z=zombie (S)
  • %CPU – This is the percentage of CPU used by this process (0.3)
  • %MEM – This is the percentage of RAM used by the process (0.7)
  • TIME+ –This is the total time of activity of this process (0:17.75)
  • COMMAND – And this is the name of the process (bb_monitor.pl)

Conclusions

Now that we have seen in detail all the information that the command “top” returns, it will be easier to understand the reason of excessive load and/or the slowing of the system.

Understanding the Top command on Linux,布布扣,bubuko.com

时间: 2024-10-13 11:58:51

Understanding the Top command on Linux的相关文章

Linux学习笔记--top命令(监控linux系统状况的命令)

top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,比如cpu.内存的使用等,类似于Windows的任务管理器. 1. 命令格式: top [选项] 2. 常用选项: "top -c" 显示完整的命令行而不只是显示命令名. "top -d" 指定每两次屏幕信息刷新之间的时间间隔. "top -n 3" 指定循环的次数为3次. "top -u 用户名" 指定用户名. "top -p 进

Using Android Phone to recover SD card formatted with DD command under linux

1. Formatted a sd card with dd command under linux 2.insert the sd card into an android phone,certainly the card is not find and used.. 3 reset the android phone with format sd card option. 4.the sd card is ok!

TOP 10 BEST LINUX GAMES RELEASED IN 2016

Gaming on Linux used to be a very rare phrase. But since the arrival of Steam on Linux, the Linux gaming community is all charged up because of the games being natively developed for Linux instead of being dependent on third-party applications like W

Creating a keytab file for the Kerberos service account (using the ktutil command on Linux)

https://docs.tibco.com/pub/spotfire_server/7.13.0/doc/html/TIB_sfire_server_tsas_admin_help/GUID-27726F6E-569C-4704-8433-5CCC0232EC79.html This method of creating a keytab file on Linux uses the ktutil command. Prerequisites Kerberos is installed on

command of linux(1)

创建命令 1.创建目录 mkdir(make directory) 目录名 例:mkdir 123 mkdir 目录名1/目录名2 例:mkdir 123/456(1和2目录相邻) 2.创建文档 gedit 文档名称 例:gedit 1.c 3.创建快捷方式 ln -s linked-file link-name 打开命令(cd) 1.打开当前目录的子目录 cd name-of-directory 2.打开当前目录的父目录 cd .. 3.打开home目录 cd 4.打开某个用户的home目录

User and Group command in Linux

本文梳理了一下Linux用户和用户组的常用的一些命令. 相关的配置文件: /etc/group 存储当前系统中所有用户组信息 /etc/gshadow 存储当前系统中所有用户组的密码 /etc/passwd 存储当前系统中所有用户的信息 /etc/shadow 存储当前系统中所有用户的密码信息 配置文件的内容格式说明: 说明:在使用cat /etc/group查看的时候,你会发现有的组最后是不显示用户列表的.那么如何查看用户组的用户名单列表,下面有code. 用户组的添加,修改,删除 group

find command in linux terminal

Say you want to search for files with keyword as "keyword". find / -name keyword 2> /dev/null

Linux 中查看进程及资源使用情况

原文:Linux 中查看进程及资源使用情况 自带的 top 命令类似于平时我们使用的任务管理器,能够列出当前系统中的进程及资源的使用情况. $ man top top - display Linux tasks 使用起来很简单,不加任何参数的情况下已经很实用了.其输出大致是下面这个样子: top命令的输出界面 按 q 可退出该界面. Tips: top 的输出每 3 秒刷新一次,如果想将画面定格,Mac 下可使用 control + s 来停止刷新,control + q 恢复刷新.当然,还可以

三大Linux command查看CPU和Memory的使用情况

1. top command : 是linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况. 2. free command : free -m 查看内存占用情况 free -S 不间断地监控有多少内存在使用 ---------------------------------------------------------------------------------------------------------------------------------- For e