Unix Server Load

posted Aug 4, 2011, 10:44 AM by Sachchida Ojha

General Performance

vmstat: Reports virtual memory statistics.

# vmstat 5 3
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 1060608 24372 739080 0 0 1334 63 1018 1571 14 11 66 10 0
0 0 0 995244 24392 799656 0 0 6302 160 1221 1962 10 10 62 18 0
0 0 0 992376 24400 799784 0 0 1 28 992 1886 3 2 95 0 0
#

CPU Usage

sar:Collect, report, or save system activity information.

# sar -u 10 8
Linux 2.6.32-100.0.19.el5 (ol5-112.localdomain) 06/27/2011

02:01:09 PM CPU %user %nice %system %iowait %steal %idle
02:01:19 PM all 1.01 0.00 0.50 0.00 0.00 98.49
02:01:29 PM all 2.72 0.00 2.62 0.10 0.00 94.56
02:01:39 PM all 1.21 0.00 0.60 0.40 0.00 97.79
02:01:49 PM all 1.00 0.00 0.60 0.10 0.00 98.29
02:01:59 PM all 1.21 0.00 0.70 0.10 0.00 97.99
02:02:09 PM all 1.01 0.00 0.40 0.10 0.00 98.49
02:02:19 PM all 0.80 0.00 0.50 0.20 0.00 98.49
02:02:29 PM all 2.92 0.00 2.42 0.10 0.00 94.56
Average: all 1.48 0.00 1.04 0.14 0.00 97.34
#

mpstat:Reports processor related statistics.

# mpstat 10 2
Linux 2.6.32-100.0.19.el5 (ol5-112.localdomain) 06/27/2011

01:59:57 PM CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s
02:00:07 PM all 1.21 0.00 0.90 0.20 0.00 0.00 0.00 97.69 980.50
02:00:17 PM all 0.70 0.00 0.40 0.00 0.00 0.10 0.00 98.79 973.77
Average: all 0.95 0.00 0.65 0.10 0.00 0.05 0.00 98.24 977.14
#

top:Displays top tasks.

# top
top - 13:58:17 up 2 min, 1 user, load average: 2.54, 1.11, 0.41
Tasks: 160 total, 6 running, 154 sleeping, 0 stopped, 0 zombie
Cpu(s): 77.1%us, 22.6%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.3%hi, 0.0%si, 0.0%st
Mem: 2058872k total, 879072k used, 1179800k free, 23580k buffers
Swap: 4095992k total, 0k used, 4095992k free, 620116k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2882 oracle 20 0 610m 64m 56m R 24.9 3.2 0:02.20 oracle
2927 root 20 0 90328 3832 2604 R 24.6 0.2 0:00.89 Xorg
2931 oracle 20 0 605m 34m 31m R 11.5 1.7 0:00.35 oracle
2933 oracle 20 0 605m 34m 30m S 9.8 1.7 0:00.30 oracle
2888 oracle 20 0 614m 52m 40m S 6.9 2.6 0:00.78 oracle
2935 oracle 20 0 604m 22m 20m S 6.2 1.1 0:00.19 oracle
2937 oracle 20 0 604m 19m 17m R 4.6 1.0 0:00.14 oracle
2688 oracle -2 0 603m 15m 13m S 4.3 0.8 0:01.08 oracle
2685 oracle 20 0 603m 15m 13m S 0.7 0.8 0:00.22 oracle
2939 oracle 20 0 217m 4084 3504 R 0.7 0.2 0:00.02 oracle
2698 oracle 20 0 604m 18m 16m S 0.3 0.9 0:00.17 oracle
2702 oracle 20 0 609m 22m 14m S 0.3 1.1 0:00.17 oracle
2704 oracle 20 0 618m 21m 19m S 0.3 1.1 0:00.21 oracle
2714 oracle 20 0 603m 20m 18m S 0.3 1.0 0:00.18 oracle
1 root 20 0 10364 704 588 S 0.0 0.0 0:00.36 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
4 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
6 root 20 0 0 0 0 S 0.0 0.0 0:00.03 events/0
7 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuset
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns
#

The PID column can then be matched with the SPID column on the V$PROCESS view to provide more information on the process.

SELECT a.username, 
a.osuser,
a.program,
spid,
sid,
a.serial#
FROM v$session a,
v$process b
WHERE a.paddr = b.addr
AND spid = '&pid';
Comments