101 3.6 modify process execution priorities
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
244
On Slideshare
244
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
5
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Junior Level Linux Certification
  • 2. Exam Objectives Key Knowledge Areas Know the default priority of a job that is created. Run a program with higher or lower priority than the default.. Change the priority of a running process. Objective 3: GNU and Unix Commands Modify process execution priorities Weight: 2 Terms and Utilities nice ps renice top 2
  • 3. Modify process execution priorities In Linux kernel, the scheduler is responsible for deciding which process is going to occupy the CPU's attention for the next millisecond. One of the factors for making this decision is the priority or niceness of the process. Process priority 3 1.Using nice you can change the niceness of new processes. 2.Using renice you can change execution priorities of running processes.
  • 4. Modify process execution priorities nice - To change the priority of a process that is started You make it behave more nicely so it does not monopolise the CPU Using nice 4 Niceness values range from: 20 (very nice) to 20 (not at all nice, quite important). -n switch specifies just how nice the process should be • nice -n 15 process – start the process with a niceness of 15 • nice -15 process – start the process with a niceness of 15 • nice -n -15 process – start the process with a niceness of 15(higher priority) The niceness of a process is inherited by the processes it creates. If the login sequence for a user sets the niceness of that user's processes, all processes run by the user are also nice.
  • 5. Modify process execution priorities renice - used to set the priority of processes that are already running Using renice 5 renice can zap specific processes or the processes owned by a user or a group. • renice +1 -p 14292 – make process 14292 just a little nicer • renice +2 -u jack – make all of Jack's processes two notches nicer. • renice +3 -g users – make the processes whose group is “users” three notches nicer. 1.Users can only increase the niceness of their own processes. 2.Root can increase or decrease the niceness of any process. 3.If a process's niceness is 20, then it will only run when nothing else wants to.
  • 6. Modify process execution priorities ps (process status) reports niceness of processes in the column STAT If process has any degree of niceness, the status column includes N. ps and niceness 6 ps can be convinced to display the niceness of each process – but you wouldn't want to do this. (It's probably not in exam). jack@foo:~> ps x PID TTY STAT TIME COMMAND 2461 ? SN 0:00 /usr/sbin/sshd 2463 pts/1 SN 0:00 -bash 2510 pts/1 RN 0:00 ps x Ex: Ex: george@foo:~> ps -eo pid,nice,user,args --sort=user | head PID NI USER COMMAND 2636 10 george /usr/sbin/sshd 2638 10 george -bash 2663 10 george ps -eo pid,nice,user,args --sort=user 2664 10 george head 1196 0 at /usr/sbin/atd 589 0 bin /sbin/portmap 21330 10 michael /bin/sh /usr/X11R6/bin/kde 21380 10 michael kdeinit: Running... 21383 10 michael kdeinit: dcopserver --nosid
  • 7. Modify process execution priorities top - shows the top processes on computer. Those that use all the resources top runs in console, and displays summary info at the top and a sorted list of processes. ps and niceness 7 Ex:
  • 8. Fim de sessão 8