Performance tuning basic OS analysis
Top Command Analysis
Top
command is used to show the Linux process
This
command shows the summary information of the system and the list of process
which are currently managed by the kernel
Top
command we need to check two session summery session and task session
Summery session
System
Time, Up time and user session
Load
average
Tasks
CPU
usage
Memory Usage
top - 11:59:39 up 225 days, 22:31, 136 users,
System
time: 11:59:39
Up
time: up 225 days, 22hrs:31min
User
session: 136 users connected.
Load
average
Load
average is the system load calculated over given period 1,5 and 15 minutes
Load
average have 3 sessions
Load average: 4.43, 4.14, 4.03
Load
average over last 1 minutes is 4.43
Load
average over last 5 minutes is 4.14
Load
average over last 15 minutes is 4.03
The
high load average that system is overloaded many processes are waiting for CPU
time
Tasks
Tasks session showing how many processes running total
Tasks: 1431 total, 5 running, 1426 sleeping, 0 stopped, 0 zombie
Total
processes 1431
Running
processes 5
Sleeping
processes 1426
Stopped
processes 0
Zombie
processes 0
If
zombie processes, we need to check otherwise it will consume more CPU and
server process.
CPU usage
Cpu(s): 5.2%us, 0.3%sy, 0.0%ni, 94.4%id, 0.1%wa, 0.0%hi, 0.0%si,
0.0%st
us-
User CPU time
sy-
System CPU time
ni-
User nice CPU time
Id-
Idle CPU time
Wa-
Wait IO CPU time
Hi-
hardware interrupt
Si-
software interrupt
St-
steel time
Memory
Usage
Memory
usage we need to monitor 2 session physical memory and swap memory
Mem: 130083456k total, 126350812k used, 3732644k free, 2222124k buffers
Swap: 4194300k total, 355904k used, 3838396k free, 96284252k
cached
Swap
memory:
Swap
space in Linux is used when the amount of physical memory (RAM) is full.
If
the system needs more memory resources and the RAM is full, inactive pages in
memory are moved to the swap space.
While
swap space can help machines with a small amount of RAM.
Buffers
Refers
to data that is being written that memory cannot be reclaimed until the write
is complete.
Cache
Refers to
data that has been read -- it is kept around in case it needs to be read again,
but can be immediately reclaimed since it can always be re-read from disk.
Task session
PID-
Process Id.
User:
Whish user started the process.
PR
Or PRI: Process actual priority.
NI:
Nice value.
VIRT:
Virtual memory How much memory assigned to the process.
RES:
Physical ram consumed by the process.
SHR:
Shared memory.
%CPU:
How much % using CPU for process
%MEM:
How much % using memory for process
Vmstat Analysis
Virtual
memory statistics
report
Vmstat
commands:
Vmstat
-a list of active and inactive memory
Vmstat
-s switch displays summary of various event counters and memory statistics.
vmstat with
-d option display all disks statistics.
Process:
r-
Number of processes in running state.
b-
Number of processes in uninterruptible sleep state.
Memory
Swpd:
The amount of virtual memory used.
Free:
The amount of idle memory.
Buff:
The amount of memory used as buffer.
Cache:
The amount of memory used cache.
Swap
SI-
The amount of memory swapped in from disk.
SO-
The amount of memory swapped to disk
If
si and so performing disk read and disk write operation. If it showing high
value will get out of memory usage error.
IO
Bi-
Blocks received from a block device.
BO-
Blocks sent to a block device.
If
BI and BO values is high database or server load high.
System:
In-
Number of interrupts per second
Cs-
Number of context switches per second
CPU
US:
User process
SY:
System process/OS process
Id:
Idle time
Wa:
Waiting for IO
Comments
Post a Comment