Menu

Dipesh Majumdar

Blog and Paintings

Some useful Linux Commands - 4

November 4, 2015

Lets talk about performance - 

i/o waits - 

appuser@hostname:~> top

top - nn:nn:nn up nnn days,  n:nn,  n users,  load average: n.nn, n.nn, n.nn
Tasks: 131 total,   1 running, 130 sleeping,   0 stopped,   0 zombie
Cpu(s):  n.3%us,  0.n%sy,  n.0%ni, n7.3%id,  0.9%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   nnnn624k total,  1829nnnk used,    1093nnnk free,    42nnnk buffers
Swap:  nnnnnnnk total,   nnnnn2k used,  nnnnn04k free,   55nnn8k cached

  PID USER         PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
2nn39 appuser      20   0 nn12m 1.1g  15m S  2.3 58.6   4:59.61 java
    1     root      20      0 nnn28  552  nn4 S  0.0  0.0   0:04.42 xxxx
    2     root      20      0     0    0    0 S  0.0  0.0   0:00.04 kthxxxxx

 

sar -  gives a 10 minute interval report of %iowait

 

appuser@hostname:~> sar
Linux 2.n.32-358.xxn.x8n_6n (hostname)       11/04/2015      _xnn_nn_        (1 CPU)*

12:00:01 AM     CPU     %user     %nice   %system   %iowait    %steal     %idle
12:10:01 AM     all      1.25      0.00      0.49     20.33      0.00     77.93
12:20:01 AM     all      1.04      0.00      0.39      4.52      0.00     94.05
.................

..............and so on and on................

*note: this is the same sar command with which you can also find how many cpu's present in a server. There is another way of finding same information - cat /proc/cpuinfo

CPU percent utilization -

The below yellow highligt cpu utilization is per CPU. Number of cpu's per server can be found by : cat /proc/cpuinfo

appuser@hostname:~> top

top - 16:nn:24 up 1nn days,  8:nn,  5 users,  load average: 0.07, 0.02, 0.01
Tasks: 131 total,   1 running, 130 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.4%us,  0.7%sy,  0.0%ni, 97.3%id,  0.9%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   nnnnnn4k total,  nnnnn24k used,    nnnn200k free,    nnn48k buffers
Swap:  419nnn6k total,   nnnnnnk used,  nnnn304k free,   nnn908k cached 

 

Memory utilization - 

appuser@hostname:~> top
top - 10:38:14 up 75 days, 23:19,  1 user,  load average: 0.00, 0.05, 0.02
Tasks: 144 total,   1 running, 143 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.5%us,  0.2%sy,  0.0%ni, 99.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  nn603800k total, nn414980k used,   nn8820k free,   nn9508k buffers
Swap:  nnn4296k total,   nnn848k used,  nnn2448k free, nnn86396k cached

  PID USER      PR        NI  VIRT      RES       SHR S        %CPU      %MEM    TIME+       COMMAND
13694 appuser   20        0     23.8g      9.7g       7340 S        1.7            41.5         818:05.79     java

But if there is java application - you don't get any hint of how jvm memory is utilized, so in that case it's better to view the memory utilization using jvisualvm

In windows, mostly this is the location - C:\Program Files\Java\jdk1.7.0_67\bin

where you will find - jvisualvm.exe

 

Go Back

Comment