cs340 week 4 assignment
Operating Systems – Week 4 Assignment
The Process Scheduler
You will need to locate and utilize performance analysis tools and process scheduling tools to complete this assignment.
Your mission this week is to analyze and manipulate the process scheduler in action on your LINUX system. You will use Linux commands to alter scheduling policies and process priorities while analyzing the effects and resulting performance.
Useful commands for this assignment:
And as always “man” is your best friend
Answer the Following:
What is an interrupt? What specifically on your system causes interrupts?
What is a context switch?
Start your Linux Partition from a fresh boot and open the Terminal. Do not open any other applications at this time. Determine values for each of the following. Provide screenshots of command output.
For a 30 second time interval:
About how many interrupts per second?
About how many context switches per second?
At a high level, what events are likely causing the current values for interrupts and context switches?
IMPORTANT: Before performing the tasks below, you will want to open at least one terminal window and maybe 2. You should be watching the performance statistics WHILE these applications are opening! This will yield the most valuable results in this lesson. i.e. Use vmstat to watch CPU statistics in real time as the system becomes busy. Continue watching values once the applications finish opening.
Open as many applications as you can while still maintaining a Linux system that functions (the slower the system the better).
Now repeat the steps from above and record new values.
Summarize finding for interrupts and context switches for each:
· Before opening applications
· While opening applications
· Shortly After all applications have opened
Find three processes in different “states.” List the process name, its current state, and what this means.
Find 3 processes using different priorities / nice values. List the process name, the priority and nice values, and what these values mean?
What is the scheduling policy of the three processes using the most CPU currently? (It is OK if they are all the same).
Change the priority of any process using the chrt command. Record before and after values. Note any noticeable effects on performance if any.
Change the nice value of any process. Record before and after values. Note any noticeable effects on performance if any.
You will want to use multiple terminal windows for this part. i.e. Use one to watch “top” values and another to enter commands.
Switch to the “root” user as you will require elevated privelges:
sudo su – root
then enter the password for the account you setup for yourself.
Use the following command to simulate system load:
dd if=/dev/zero of=/dev/null &
run the command at least twice so that there are 2 “dd” processes running. You can launch as many of them as you want at one time. You should notice these processes are using equal amounts of CPU at first.
Pick one of these processes to make adjustments to.
Change the priority using the chrt command to various high and low priorities. Note effects on CPU usage and response time in your command shell if any.
Change the process scheduling algorithm using the “chrt” command. List current scheduling algorithm for the process and new scheduling algorithm. Note effects on CPU usage and response time if any. Use all possible scheduling policies at least once. NOTE: “chrt –m” lists possible priority values.
NOTE: To kill a process: “kill pid”
i.e. if the process id is 4149
You may need to kill a process if the system becomes unresponsive. You may also need to restart the partition!!!
You will submit a Word or Libre Writer Document which contains results from the above analysis and responses. I do not have access to your system so you need to be sure to provide screenshots for anything I cannot possibly know. i.e. results from command output and top output.
Please insert your screenshots into your word document with supporting documentation which meets all requirements. You will be penalized for any results which are not backed by proof.
A large portion of this class is exploring and researching solutions on your own!
You will continue to operate as a systems administrator / analyst and thus you will be expected to figure out what you need to know on your own. You will not find exact solutions in your book which give you what you need to know to complete this assignment or future assignments.
What you will find in your book is an in depth analysis of how an operating systems manages memory at a low level. This is imperative in understanding what the resulting data values mean from your research.