Sometimes we're going to need
to get informations about our specific CPU,
so the best thing to do is we can use less command,
we're going to use a proc folder.
We're going to do cpuinfo.
Now this screen gives us a lot of good information
about the type of processors that we're using.
It identifies the number of processors
that we're referring to.
'Cause sometimes we might be in a situation
where we have multiple processors.
And we can see some good information here.
Of course, cache size.
We can also see the cpu cores,
the amount of cores associated with this CPU.
We can see speed with the cpu MHz,
how fast it should be performing.
And again, this is going to help us do some research,
so when we start looking at more detailed information,
we can get a good gauge
on how fast should our CPU be running,
which will determine how fast our system can operate.
Another command we're going to like to use is called uptime.
The most important part of this information
is going to be the load average.
The first field is for a one-minute increment.
The second field is for five-minute increments.
And the third field is for 15-minute increments.
Now what this tells us is the average amount of processes
that are being active or waiting to be used
in that timeframe.
So for example, for one minute, on average for that CPU,
it's only taking 0.08 percentage/usage capacity
for that CPU.
And the same thing for the five-minute increment
and the 15-minute increment.
Now of course, the first field that we see
all the way to the left, it just lets us know how long
has the system been up from the very beginning,
since this last reboot.
The next command we would like to be familiar with
is the sar command.
It lets us see a breakdown
of a lot of different information.
This report consists of various sections,
each of which consists of the type of data
at the time it was collected.
The default mode of the sar command displays the CPU usage
in various time increments for each category of resource
that access the CPU, such as users, the system,
input/output scheduling, etcetera.
And what's here at the bottom of the report,
this is the average of all the information
compiled together.
Now another way we can format this sar command
is we can use these two options.
And what those two options determine is every 2 seconds,
it's going to give us a total of 6 queries.
So again, as you see like the last screen,
it was kind of a lot of information all at once,
but now we can kind of see things as they're happening,
which will further help us isolate CPU performance issues.
Now also with the sar, we can use this S option.
It's going to give us swap space information.
Now swap space is going to be key
when you're dealing with systems that have low RAM usage
because it's going to use the physical memory
in order to offload some of that processes
that the RAM's typically using.
But we see here in my system,
I'm not using much CPU speed, I'm only running the shell.
So it's not going to be cause for too much concern.
But when you're using a server
that's really dealing with a lot of requests simultaneously,
you might see the swap space used a certain period of time.
Another good place to find information about your memory
is going to be in that proc folder again.
This time it's going to be under meminfo.
And we went through multiple ways to check our memory.
And I think at this point we can all agree
that memory is vital to performance of any type of system,
especially when it comes to servers.
All right, now another way to quickly look at memory
is the free command.
It just gives us a quick view of what's free
in our RAM and also in our swap memory.
And of course, whenever we need a human-readable format,
it helps us see a little bit better
by converting things to megabytes and gigabytes,
things that we're used to using
when we're reading information and reports.
And also if we're looking for a specific type of things,
we can just set it up for megabytes
and probably even gigabytes if we wanted to.
Again, all these things are just for formatting the report,
and the human-readable is probably going to be
the most commonly used and most useful option for us.
And one of the final commands we're going to go over
is the vmstat command.
So what that does is, again, we can use the same options
that we use for the sar command.
Pretty much what that does is it allows us
to tell the system, "Hey, every 5 seconds
we want 3 queries total."
Because when you typically use the vmstat command,
it only displays the last information
from the most recent reboot.
So this is going to give us a good look into what's going on.
And this is just without the option.
And we could also use the same command,
but we're going to use a d option.
And it helps us determine the information per device.
So now it helps us isolate which partitions
are using the most memory.
Thank you for sticking with me with this walkthrough,
and I'll see you in the next lesson.