Linux - How to find linux server resource utilization, How to find idle state of linux server

How to find linux server resource utilization

How do I find resource, memory and high disk I/O usage in linux server?

How can I find system resource utilization using vmstat command?

vmstat command prints the information about processes, memory, paging, block IO, traps, and cpu activity. This is a common command used by linux system admin. Please note that Linux vmstat does not count itself as a running process.

vmstat example
 # vmstat 1 5
This command prints the output for five times with one second as interval.
OUTPUT
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
 0  0  51336  39528 220904 7528092    0    0    56   353    0     0  1  2 95  2
 0  0  51336  39528 220912 7528084    0    0     0    24 1010   401  0  0 96  0
 0  0  51336  39528 220916 7528080    0    0     0   100 1017   424  0  0 99  1
 0  0  51336  39528 220920 7528076    0    0     0    88 1009   411  0  0 98  2
 0  0  51336  39600 220920 7528076    0    0     0    44 1013   446  0  0 99  0

vmstat: print output in MB
 # vmstat -S M
OUTPUT
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
 2  0     50     52    204   7346    0    0    56   353    0     0  1  2 95  2
The fist line is nothing but six different categories. The second line gives more information about each category. This second line gives all data you need

-S M: vmstat lets you choose units (k, K, m, M) default is K (1024 bytes) in the default mode. Without -M option it will use K as unit.

Field Description For Vm Mode

(1) procs is the process-related fields are:
r: The number of processes waiting for run time.
b: The number of processes in uninterruptible sleep.

(2) memory is the memory-related fields are:
swpd: the amount of virtual memory used.
free: the amount of idle memory.
buff: the amount of memory used as buffers.
cache: the amount of memory used as cache.

(3) swap is swap-related fields are:
si: Amount of memory swapped in from disk (/s).
so: Amount of memory swapped to disk (/s).

(4) io is the I/O-related fields are:
bi: Blocks received from a block device (blocks/s).
bo: Blocks sent to a block device (blocks/s).

(5) system is the system-related fields are:
in: The number of interrupts per second, including the clock.
cs: The number of context switches per second.

(6) cpu is the CPU-related fields are:
These are percentages of total CPU time.
us: Time spent running non-kernel code. (user time, including nice time)
sy: Time spent running kernel code. (system time)
id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
wa: Time spent waiting for IO. Prior to Linux 2.5.41, shown as zero.

To run vmstat with five updates, with five seconds interval, type
 # vmstat -S M 5 5
OUTPUT
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa
 0  0     50     52    205   7345    0    0    56   353    0     0  1  2 95  2
 0  1     50     52    205   7345    0    0     0    46 1027   408  0  0 99  0
 1  0     50     52    205   7345    0    0     0    57 1017   410  0  1 98  0
 0  0     50     52    205   7345    0    0     0    63 1013   416  2  6 92  0
 0  0     50     52    205   7345    0    0     0    38 1011   410  0  0 99  0
-S M : Gives you output in MB.

Another best method to analysis is
 #vmstat -S M -s
OUTPUT:
         8827 M total memory
         8786 M used memory
         7110 M active memory
         1398 M inactive memory
           40 M free memory
          215 M buffer memory
         7350 M swap cache
         1023 M total swap
           50 M used swap
          973 M free swap
    198690778 non-nice user cpu ticks
       659204 nice user cpu ticks
    288365345 system cpu ticks
  13541058305 idle cpu ticks
    232292796 IO-wait cpu ticks
      2042720 IRQ cpu ticks
     10992245 softirq cpu ticks
   8014882122 pages paged in
  50342223845 pages paged out
       300621 pages swapped in
       970452 pages swapped out
   1318146732 interrupts
    698220495 CPU context switches
   1289821034 boot time
     77380025 forks

 # vmstat -V

 OUTPUT:
 procps version 3.2.7

The topic on Linux - How to find linux server resource utilization is posted by - Math

Hope you have enjoyed, Linux - How to find linux server resource utilizationThanks for your time

Tech Bluff