CPU Monitoring

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
21 hours 25 minutes
Difficulty
Intermediate
CEU/CPE
21
Video Transcription
00:00
>> Hey, cybrarians, and welcome back to
00:00
the Linux plus course here at Cybrary.
00:00
I'm your instructor Rob Gels.
00:00
In today's lesson, we're going to
00:00
be covering the CPU monitoring.
00:00
Upon completion of this lesson,
00:00
you are going to be able to understand
00:00
the importance of CPU monitoring,
00:00
we're going to see where we can locate CPU information,
00:00
and then we're going to use
00:00
the uptime command to determine the load on the CPU.
00:00
CPU monitoring is important because we need to
00:00
determine if a system processor is overloaded,
00:00
and if so, what's causing the load.
00:00
However, before we begin troubleshooting CPU stuff,
00:00
we need to understand CPU hardware.
00:00
The way that we can understand that is by
00:00
looking at the/proc/cpuinfo file,
00:00
that's going to contain information
00:00
about the number of CPUs,
00:00
the number of cores, cache sizes,
00:00
and whether hyper-threading is
00:00
enabled or disabled on the CPU.
00:00
Once we have that information,
00:00
we can begin looking at the load on the system.
00:00
Now, oddly enough,
00:00
the uptime command is used to
00:00
show how long the system has been running.
00:00
Sure. But it also displays
00:00
a load average and it displays that over 1,
00:00
5, and 15 minute intervals.
00:00
Now, this information needs to be
00:00
interpreted based on the number of CPUs in the system,
00:00
which is why we look at CPU info first.
00:00
Let's have a look at both of
00:00
these things with some demo time.
00:00
Here we are in our demo environment on CentOS 8.
00:00
As I said previously,
00:00
the very first thing we need to do is
00:00
look at the/proc/cpuinfo file.
00:00
We can do that by just doing a cat on proc CPU info.
00:00
On this machine, this is a virtual machine
00:00
and not a physical server,
00:00
and I only have one processor,
00:00
which is identified here as processor 0.
00:00
When running this on a physical server,
00:00
you will have lots more output.
00:00
In fact, I recommend running this with less.
00:00
You would just do instead of cache,
00:00
you just do a less proxy CPU info.
00:00
Otherwise, it's going to scroll off
00:00
your screen and with less,
00:00
you can page through that output.
00:00
But now that we have this information,
00:00
we can actually look at our load average with
00:00
uptime and we can better interpret it.
00:00
Let's clear the screen.
00:00
I'm just going to hit "Control L".
00:00
Now, we can run uptime.
00:00
Let's hit "Enter". [NOISE] Now,
00:00
we can see here are the one-minute,
00:00
five-minute, and 15-minute averages
00:00
from left to right here.
00:00
For example, we see 0.02,
00:00
0.03, and 0.02.
00:00
This actually indicates two percent, three percent,
00:00
and two percent CPU for the 1,
00:00
5, and 15 minute averages respectively.
00:00
Basically, you're just going to use
00:00
>> the information that
00:00
>> you get from proc/cpuinfo
00:00
and then use that information to
00:00
get a better idea of what
00:00
the actual load average is based on
00:00
the number of processors you have in your system.
00:00
With that, we've reached the end of this lesson.
00:00
In this lesson, we covered
00:00
understanding the importance of CPU monitoring,
00:00
as well as working with the/proc/cpuinfo file,
00:00
and then using that uptime command
00:00
to determine the load on
00:00
the CPU based on
00:00
the information you get out a proc/cpuinfo.
00:00
Thanks so much for being here and I look
00:00
forward to seeing you in the next lesson.
Up Next