Performance Engineering and Tuning


language: EN

                  WEBVTT
also can generate logs that you can use later on.
And then it does multiple system resource monitoring,
which is more or less the same things.
But when it comes to this one in Linux,
it also includes system processes, right?
But more or less, you can interact with the different
resources that you want to monitor, like your CPU,
your memory, your disk, your processes, you know.
When you're running, you should be able to have the option
just the disk, for example, you want to monitor the disk,
so it will show you statistics of just the disk, right?
But also you can log and then log everything to a file,
right, or to, you send it to a file for further analysis,
maybe later on, you know?
And you can actually give it for how many times
should it do it, how many times should it run,
how many times should it log.
So for example, on that red command, it's saying,
log data every 60 seconds for 720 intervals,
which means it's 12 hours.
So every 60 seconds, every one minute,
it has to log information onto it, you know?
And the common metrics that obviously will be monitored,
the normal ones, your CPU, your memory, your disk,
or your network, right?
Which obviously then helps you to be able to see
what could be happening exactly.
All right, so your default output, for example,
if you press C for CPU, right,
you get the percentage of time the CPU spends
on a user process, and you get the percentage CPU time
spent on system or kernel processes, right?
You also have things like your waiting,
what time the CPU spends waiting for IO operations,
like accessing the disk, for example, or the network.
It will show you that, or some idle,
not executing any process,
it will also show you that time.
Also, the time the CPU spends handling hardware interrupts.
And it's sometimes spent on software interrupts.
So it sort of gives you a whole lot of times
that are happening, which you can be able to use
to determine what could be happening, you know?
Time the CPU spends on tasks not visible to the host OS,
you know, maybe due to virtualization
or something like that, you know?
So those are some of the stuff that you can be able to see.
But when you see high percentages in places
like wait time, right, for IO operations,
wait time for system or kernel processes, you know,
you should worry about it
because then there's something that's holding it.
It should be quick.
Those operations should be quick.
It shouldn't take time, you know?
And then when you look at memory,
you look at the total amount of memory in the system,
and then you look at the used,
the amount of memory currently in use,
the free memory, and then the shared memory
between processes, you know,
especially when they're used by shared libraries.
And then your buffers,
memory used to block IO caching,
memory used by cache itself
for storing frequently accessed files, right?
Remember the in-memory cache?
And then swap space used, it also shows you that,
which would then help you to look at
what is it that you can change.
Then you also have VM start
when you have a virtualized environment, especially.
VM start, you monitor your
virtual memory statistics, your CPU activity,
your disk IO paging and processing.
Did your colleagues come?
Or isn't?
Two?
Oh, okay.
Did you catch a bug?
And the truth is not the best.
The other week when your colleagues were here,
I had to get it taken out.
So I took it out the Friday.
They were coming over the weekend, right?
I took it out the Friday.
But when they took it out,
they didn't know that there's some pieces
that were left inside.
So I would come in,
I came in Monday, Tuesday, Wednesday,
and it was so painful.
Like it didn't make sense.
I would survive on painkillers.
I had to go back and so that they clean, you know,
because it wasn't healing.
Even if I was on antibiotics,
but still it wasn't healing.
So they had to go back and actually clean it.
But now it's better.
I took this, it was very painful.
What kind of painkillers were you taking?
I had Tramadol.
Tramadol.
Yes, Tramadol, yes.
They gave me Tramadol.
I can always drink one tomorrow.
One thing.
It's a very powerful painkiller.
But also it can cause drowsiness.
So he's going to sleep.
In the afternoon, are they going to come?
Are they going to come here?
No, no, they only live.
Oh, they only live.
Oh, they only live in France.
Okay.
Okay.
But Tramadol is a good one.
And the only other issues,
you might not get it over the counter.
But for over the counter, you can look for one that's good.
You can buy Grandpa.
It's called Grandpa.
Yes, Grandpa.
Yeah, you can even get it at a garage even.
It's a very good painkiller.
Like it's very good.
We usually, we use it a lot when we are hungover.
Because it takes care of the headache,
takes care of the pains.
But for now, until he gets home,
to get it removed, if he's getting it removed,
he can buy Grandpa.
It usually subsides in a few minutes.
Yeah.
All right, cool.
So then with VMSTAT, you get your,
things like your CPU activity for your virtual machine,
your IO, your paging, you know,
and you get real time, obviously, performance.
Historical data, you can track back over time
by running VMSTATs in intervals.
So like three minutes or five minutes,
you need to log every one minute or something, you know?
You can be able to do that.
And then the output of VMSTATs,
usually it's procs, which is the processes,
waiting for memory in the running state,
and then information about the physical memory usage, right?
Where you include free memory, swap space and buffers,
and then swap information about swap, your disk IO,
your number of interrupts and contact switches,
and then your CPU usage.
That example is not as clear as I've wanted it,
but on the exercise, you should be able to see it, right?
And just some explanation on the columns for VMSTATs.
So your procs, your processes,
where it says R is the number of processes
waiting for time run, for runtime, right?
Ready to run.
And then where it's B, it's number of processes
in uninterruptible slip, they are waiting for IO, right?
When you get to the memory section,
there's your swap, there's your free,
there's your buffer, there's your cache,
of which I think we are familiar with it.
And then the swap, we've got the SI,
which is the memory swapped in from disk,
and SO memory swapped out of disk.
And then you've got the IO,
so number of blocks received from a block device,
which is the reads, and number of blocks sent
to a block device, which is the writes.
And then we've got the system
where you've got number of interrupts per second,
and then context, number of context switches per second,
and then your CPU obviously has got all those,
all that information, CPU time spent in user space,
system space is spent idle.
Most of these tools more or less talk about the same thing,
if you look at it.
They more or less talk about the same thing.
The common metrics you monitor in using VMSTATs,
your memory, your CPU, your IO, your processors,
you know, that's more or less it.
I think with these tools,
it depends which one works for you.                

on 2024-12-04

Visit the Performance Engineering and Tuning course recordings page

6 videos