So we need to work from a root cell to make that a little bit easier. I'm using sudo I.
Then I want to do something and let me show you what I want to do.
LSCPU convenient command that is showing CPU information.
If you scroll up a little bit, then you can see that I have two online
CPUs and this lab is so much nicer if you do it with one CPU only.
So I am going to use echo zero sys bus CPU devices CPU one online.
What is going on? Well, the sys interface is an interface that allows you to manage hardware properties.
And every single CPU has a directory with its properties in this interface, which is memory only.
And I'm using echo zero to send an echo to the file online. You know what the result is? If
I type LSCPU and I check again, then I can see that now I have one CPU that is offline.
It's easier to see how our priority changes are going to work if we have one CPU only.
Now let's do ddif is dev0 of is dev null
and do that three times. So 1, 2 and 3.
Then I'm going to use stop to see that the processes are running as expected.
So what am I expecting? I'm expecting that all of them are getting an equal amount of CPU cycles.
I want to change that and I'm going to do that so that
one of these three jobs gets double the amount of CPU resources.
Well, double the amount. That's a little bit difficult, but we definitely need to re nice.
I would say use the PID that you want to renize and figure out a value. You want it
to be higher and just a little bit. Start with minus 5 and see what it is doing.
So we need to wait a little bit and well, this is double enough as far as I'm concerned.
So we have one of these DD processes running with a higher priority.
When you are running with a higher priority, don't immediately use -20 because
you will leave no space for others. Don't go in increments of 5.
That is normally doing. All right, then we need to terminate all processes in order to
terminate all processes. I'm getting back to my command line and I'm using killall dd.
Of course I should not forget to do my fun thing with my multiple CPUs where before I used
Echo Zero to this fell to disable. Now I'm going to use Echo One to to enable the CPU
again and we still see the feedback from the commands that have been terminated in the background.
And once we do a quick check in top, we can see the DDS are gone. And
when I press one, then I can see all of my CPUs again, and that's all.