Linux Performance Monitoring

How to check performance of the services that are running on the system are provided with the tools to be used to control. There is more than one way to achieve the result.

The top program periodically and dynamic displays a sorted list of system processes.

We can take practically information on rows via top command.

1.1 Time and Load Average

top — 13:11:47 up 4:57, 1 user, load average: 0.08, 0.05, 0.06

The field display,

- current time

- how long period is system up

- the number of user sessions.

- 1, 5, 15 second interval load average info.

1.2 Tasks

Tasks: 61 total, 4 running, 60 sleeping, 0 stopped, 0 zombie

This section shows processes of running/runnable, interruptible sleep (waiting for complete), stopped and after defunct process. Note, through to the number of running processes, accumulated transaction in the queue can be calculated. (Running — Cores = Queue)

1.3 CPU States

%Cpu(s): 0.3 us, 0.0 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 st

It’s shown the CPU state here.

* us, user: CPU time in running (un-niced) user processes

* sy, system: CPU time in running kernel processes

* ni, niced: CPU time in running niced user processes

* wa, IO wait: CPU time waiting for IO completion

* hi: CPU time serving hardware interrupts

* si: CPU time serving software interrupts

* st: CPU time stolen for this vm by the hipervisor.

1.4 Memory Usage

KiB Mem: 506316 total, 89640 used, 416676 free, 7952 buffers

KiB Swap: 1045500 total, 0 used, 1045500 free. 39928 cached Mem

First line is for physical memory and the second for virtual memory.

1.5 Fields/Columns
  • PID

The Process ID, to uniquely identify a processes.

  • USER

The effective user name of the owner of the processes.

  • PR

The scheduling priority of the process. Some values in this field are ‘rt’. It means that the process is running under real-time.

  • NI

The nice value of the process. Lower values mean higher priority.

  • VIRT

The amount of virtual memory used by the process.

  • RES

The resident memory size. Resident memory is the amount of non-swapped physical memory a task is using.

  • SHR

SHR is the shared memory used by the process.

  • S (status)

This is the process status. It can have one of the following values:

D — uninterruptible sleep

R — running

S — sleeping

T — traced or stopped

Z — zombie

  • %CPU

It is the percentage of CPU time the task has used since last update.

  • %MEM

Percentage of available physical memory used by the process.

  • TIME+

The total CPU time the task has used since it started, with precision upto hundredth of a s


Usefully interactive commands list,

“d” or “s” with > change delay time interval

“x” > highlights

“z” > change color

“c” > name/line

“i” > idle processes

“l”, “t”, “m” > toogle load balance, task, memory

“r” > renice

“k” > kill

“1” > show cores

“u” > user filter

“P” > sort by usage processes

“M” > sort by usage memory

“N” > sort by pid

“T” > sort by time+

“B” > enable/disable Bold

“H” > thread

“W” > write configuration file

“I” > solaris mode (a task’s cpu usage will be divided by the total number of CPUs)

If you want to get pid list with bash command
“ps aux | awk ‘{print $2}’ > pid.list”
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.