SAR command: Monitor CPU, Memory, disk and IO in Linux – Part 2
Measuring CPU performance with SAR command: We will continue our journey with our SAR command. We already covered on SAR command in our first post on how to install it. In this post we will see how to use SAR command to monitor CPU, RAM(Memory), disk and IO stats. Example3: To report on CPU performance in sar command, we use the -u flag. Here is an example: [sahil@linuxnix.com:~] $ sar -u 1 2 Linux 2.6.32-642.13.1.el6.x86_64 (linuxnix.com) 10/12/2017 _x86_64_ (2 CPU) 09:13:11 AM CPU %user %nice %system %iowait %steal %idle 09:13:12 AM all 0.00 0.00 1.01 0.00 0.00 98.99 09:13:13 AM all 0.50 0.00 0.50 0.00 0.00 98.99 Average: all 0.25 0.00 0.75 0.00 0.00 98.99 Here we can see that sar is reporting CPU utilization twice at an interval of one second and we have an average line in the end. The time is as per the systems’ time zone and displays it in real time, i.e., SAR begins reporting at 09:13:11 AM and ends at 09:13:13 AM which was the actual time on the server when the command finished. Exploring the meaning of each SAR field reported %user: Percentage of CPU utilization that occurred while executing at the user level which includes application processes, user running jobs, etc. %nice: Percentage of CPU utilization that occurred while executing at the user level with nice priority. I won’t go into...
Read More