Friday, January 24, 2014

COMMAND TO CHECK MEMORY CPU USAGE + LInux

COMMAND TO CHECK MEMORY CPU USAGE. (PERFORMANCE MONITORING).
CPU MONITORING:

1. ps

2. Top

top -n 1 | grep "Cpu"
3. Vmstat

4. Sysstat

SAR

CPU Utilization: The central processing unit, as viewed from Linux, is always in one of the following states:
* idle: available for work, waiting
* user: high-level functions, data movement, math, etc.
* system: performing kernel functions, I/O and other hardware interaction
* nice: like user, a job with low priority will yield the CPU to another task with a higher priority

By noting the percentage of time spent in each state, we can discover overloading of one state or another. Too much idle means nothing is being done; too much system time indicates a need for faster I/O or additional devices to spread the load. Each system will have its own profile when running its workload, and by watching these numbers over time, we can determine what's normal for that system. Once a baseline is established, we can easily detect changes in the profile.

(System Activity Reporter)
Sysstat is actually a collection of utilities designed to collect information about the performance of a linux installation, and record them over time.

The sysstat package contains the sar, sadf, iostat, mpstat, and pidstat commands for Linux.
If sar package is activated the crontab for root should contain something like this:

# Collect measurements at 10-minute intervals //This script collects info
0/10 * * * *   /usr/lib/sa/sa1
# Create daily reports and purge old files    //This script produces report
0 9 * * *  /usr/lib/sa/sa2 -A

MEMORY USAGE:

1. cat /proc/meminfo

No comments:

Post a Comment