Tuesday, 18 August 2015

CPU or Load Average is Critical in Linux / Unix

Server Uptime:
--------------------

[username@hostname #]$uptime

Server  Hostname:
----------------------------

[username@hostname #]$hostname


Server  IP Address:
----------------------------

[username@hostname #]$/sbin/ifconfig

or 

[username@hostname #]$sudo /sbin/ifconfig  -- If y[username@hostname #]$/sbin/ifconfig

or 

[username@hostname #]$/sbin/ifconfig | grep 'inet addr:'  -- To get all the IP addresses of that server like eth0, eth1 lo


or

[username@hostname #]$/sbin/ifconfig eth0 | grep 'inet addr:' 
 

Server   mpstat:
------------------------

he mpstat command is used for checking the cpu usage in Linux and /or monitor the Linux system performance

The output result gives the processor statistics. 

If your system has multiple processor cores, you can use the mpstat command to monitor each individual core. The mpstat command provides the same CPU utilization statistics asvmstat, but mpstat gives the statistics out on a per processor basis

[username@hostname #]$/usr/bin/mpstat -P ALL

Server   vmstat:
------------------------


[username@hostname #]$vmstat 5 1   --- It execute 1 time only at the interval of 5 seconds

--- Some of the time, r (runqueue) value is higher than processor exists in the server which means CPU bottleneck.

Server Processor exists in the server:
-----------------------------------------------

[username@hostname #]$ grep -c "processor" /proc/cpuinfo

List of users logged into the system:
-----------------------------------------------

[username@hostname #]$sudo w


Top 5 memory hungry processes:
-----------------------------------------------

[username@hostname #]$ps auxxx --sort=-rss | head -6