Birmingham mumbai



Download 15,21 Mb.
Pdf ko'rish
bet231/482
Sana13.01.2022
Hajmi15,21 Mb.
#355107
1   ...   227   228   229   230   231   232   233   234   ...   482
Bog'liq
Mastering Ubuntu Server Gain expertise in the art of deploying, configuring, managing, and troubleshooting Ubuntu Server by Jay LaCroix (z-lib.org)

[
 174 
]
At this point, we know how to re-prioritize our running processes with 
renice
. Now, 
let's take a look at starting a new process with a specific priority with 
nice
. Consider 
the following command:
nice -n 10 vim 
Here, we're launching a new instance of 
vim
, but with the priority set to a specific 
value right from the start. If we want to change the priority of 
vim
 again later, we'll 
need to use 
renice
. As I mentioned earlier, 
nice
 is used to launch a new process with 
a specific priority, and 
renice
 is for changing the priority of a pre-existing process. In 
this example, we launched 
vim
 and set its nice value to 
10
 in one command.
Changing the priority of a text editor such as 
vim
 may seem like an odd choice for 
a test case, and it is. But the 
vim
 editor is harmless, as the likelihood of us changing 
the priority of it leading to a system halt is extremely minimal. There's no practical 
reason I can think of where it would be useful to re-prioritize something like a text 
editor. The takeaway, though, is that you 
can
 change the priority of the processes 
running on your server. On a real server, you may have an important process that 
runs and generates a report, and that report must be delivered on time. Or perhaps 
you have a process that generates an export of data that a client needs to have in 
order to make an on-time deliverable. So, if you think of the bigger picture, you can 
replace 
vim
 with the name of a process that is actually important for you or your 
organization.
You might be wondering what "nice" means in the context of the 
nice
 and 
renice
 
commands. The "nice" number essentially refers to how nice a process is to other 
users. The higher the nice value, the lower the priority. So, a value of 20 is nicer 
than a value of 10. In that case, processes with a niceness of 20 are running at a 
lower priority, and so are kinder to the other processes on the system. The niceness 
can range from -20 to 19. A process with a nice value of -20 is the highest priority 
possible, while 19 is the lowest priority it can have. The entire system is quite a bit 
more complicated than this simple description. Although I refer to the nice value as 
the priority, it actually isn't. The nice value is used to calculate the actual priority. But 
for now, if we simplify the nice value to be representative of the priority, and the nice 
value to equate to a lower priority, the higher the number gets, that's enough for now.
So far, we've been using the 
nice
 and 
renice
 commands along with the 
-n
 option to 
set the nice values directly. It may be interesting to note though that you can simplify 
the 
renice
 command and leave out the 
-n
 option:
renice 10 42467


Chapter 7

Download 15,21 Mb.

Do'stlaringiz bilan baham:
1   ...   227   228   229   230   231   232   233   234   ...   482




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish