1 00:00:06,879 --> 00:00:11,830 So we need to work from a root cell to make that a little bit easier. I'm using sudo I. 2 00:00:13,810 --> 00:00:17,260 Then I want to do something and let me show you what I want to do. 3 00:00:17,820 --> 00:00:21,410 LSCPU convenient command that is showing CPU information. 4 00:00:22,030 --> 00:00:26,500 If you scroll up a little bit, then you can see that I have two online 5 00:00:26,500 --> 00:00:30,969 CPUs and this lab is so much nicer if you do it with one CPU only. 6 00:00:31,510 --> 00:00:37,039 So I am going to use echo zero sys bus CPU devices CPU one online. 7 00:00:43,409 --> 00:00:48,719 What is going on? Well, the sys interface is an interface that allows you to manage hardware properties. 8 00:00:49,340 --> 00:00:56,030 And every single CPU has a directory with its properties in this interface, which is memory only. 9 00:00:56,619 --> 00:01:03,049 And I'm using echo zero to send an echo to the file online. You know what the result is? If 10 00:01:03,049 --> 00:01:09,480 I type LSCPU and I check again, then I can see that now I have one CPU that is offline. 11 00:01:10,760 --> 00:01:16,799 It's easier to see how our priority changes are going to work if we have one CPU only. 12 00:01:17,540 --> 00:01:21,960 Now let's do ddif is dev0 of is dev null 13 00:01:21,960 --> 00:01:26,379 and do that three times. So 1, 2 and 3. 14 00:01:28,269 --> 00:01:32,390 Then I'm going to use stop to see that the processes are running as expected. 15 00:01:33,450 --> 00:01:38,900 So what am I expecting? I'm expecting that all of them are getting an equal amount of CPU cycles. 16 00:01:39,739 --> 00:01:43,310 I want to change that and I'm going to do that so that 17 00:01:43,310 --> 00:01:46,879 one of these three jobs gets double the amount of CPU resources. 18 00:01:47,420 --> 00:01:52,670 Well, double the amount. That's a little bit difficult, but we definitely need to re nice. 19 00:01:53,500 --> 00:01:59,020 I would say use the PID that you want to renize and figure out a value. You want it 20 00:01:59,020 --> 00:02:04,540 to be higher and just a little bit. Start with minus 5 and see what it is doing. 21 00:02:06,500 --> 00:02:11,770 So we need to wait a little bit and well, this is double enough as far as I'm concerned. 22 00:02:12,349 --> 00:02:16,400 So we have one of these DD processes running with a higher priority. 23 00:02:17,180 --> 00:02:21,189 When you are running with a higher priority, don't immediately use -20 because 24 00:02:21,189 --> 00:02:25,199 you will leave no space for others. Don't go in increments of 5. 25 00:02:25,840 --> 00:02:31,105 That is normally doing. All right, then we need to terminate all processes in order to 26 00:02:31,105 --> 00:02:36,370 terminate all processes. I'm getting back to my command line and I'm using killall dd. 27 00:02:37,550 --> 00:02:44,073 Of course I should not forget to do my fun thing with my multiple CPUs where before I used 28 00:02:44,073 --> 00:02:50,596 Echo Zero to this fell to disable. Now I'm going to use Echo One to to enable the CPU 29 00:02:50,596 --> 00:02:57,120 again and we still see the feedback from the commands that have been terminated in the background. 30 00:02:57,699 --> 00:03:02,219 And once we do a quick check in top, we can see the DDS are gone. And 31 00:03:02,219 --> 00:03:06,740 when I press one, then I can see all of my CPUs again, and that's all.