How can i measure CPU and Memory utilization on a Linux?

CPU Utilization Commands:

CPU utilization; measured every 2 seconds; 5 times:
$ sar -u 2 5

Processor related stats:
$ mpstat
$ mpstat -P ALL

Top 10 CPU users/processes on the Linux system:
$ ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10

Memory Utilization Commands

ps aux
ps aux | awk ‘{print $4″\t”$11}’ | sort | uniq -c | awk ‘{print $2″ “$1” “$3}’ | sort -nr

Overall

To see lots of stats with a single command in real-time
$ top

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: