Question

In: Computer Science

Linux question: Take the command 'vmstat' in linux for a program, explain why the number of...

Linux question:

Take the command 'vmstat' in linux for a program, explain why the number of context switches is more than the number of interrupts?

Solutions

Expert Solution

The vmstat (virtual memory statistics) command allows you to monitor your system’s memory usage. It shows how much virtual memory there is, and how much is free and paging activity. You can observe page-ins and page-outs as they happen. This is extremely useful for detecting shortages of physical memory, which can adversely affect system performance.

Number of context switches is more than the number of interrupts because:

  • A context switch (also sometimes referred to as a process switch or a task switch) is the switching of the CPU (central processing unit) from one process or thread to another. A process (also sometimes referred to as a task) is an executing (i.e., running) instance of a program.An interrupt is simply a signal that the hardware can send when it wants the processor’s attention. A common example of this is when a packet is received by the network card; when a packet is received, an interrupt is thrown and the CPU deals with the packet
  • There are three columns when the output of vmstat is generated: us (user) time, sy (system) time, and id (idle) time. These three break down the use of the CPU time in percentages. They should add up to 100%. Ideally, a CPU will spend most of its time in the us and id categories. The sy category refers to time the CPU spends doing driver/kernel-level work. This time is taken away from user applications. If the CPUs are spending most of their time in this category, it could indicate excessive context switching due to either CPU or memory bottlenecks, issues with kernel-level locking, or other problems leading to excessive number of number of context switching. A busy system will show a constant idle percentage near zero. But a busy system doesn’t necessarily mean that the system is overloaded.

Related Solutions

Introduction Write in C++ at the Linux command line a program that is the same as...
Introduction Write in C++ at the Linux command line a program that is the same as the previous collection app project but now uses a class to store the items and also can save the items to a file that can be read back into the array by the user when the program is re-started. You can use your project 1 submission as a starting point or you can do something new as long as it meets the listed requirements....
unix/Linux Create a tar command using the man command and the link referred to in To...
unix/Linux Create a tar command using the man command and the link referred to in To Practice and Explore: Text File Utilities #9. Preliminaries Use the man pages to learn more about tar Review the links referred to in To Practice and Explore: Text File Utilities #9 to see examples of using tar command Perform Use tar "to stuff" three files and then "unstuff" them into a new directory. Include the -v option. Task ll to show the original 3...
LINUX In Linux command line write a shell script ex1.sh that uses IF THEN to Prompt...
LINUX In Linux command line write a shell script ex1.sh that uses IF THEN to Prompt the user to "Enter a number between 1 and 10". (Hint: Use the 'echo' and 'read' commands in the script. See the slide about the 'read' command) If the number is less than 5, print "The number is less than 5" (Hint: You will read input into a variable; e.g. read NUM. In the IF statement, enclose $NUM in quotes; e.g. "$NUM". Also, remember...
Linux operation 1. Explain what this command does: rpm –qai | more ..... ? 2. Ps...
Linux operation 1. Explain what this command does: rpm –qai | more ..... ? 2. Ps – Af |grep -v ^root, Explain how this command to find application processes could helpful in the real world to the system administrator?? 3. Clearly describe 3 valid command options, and their meaning, of this command used to add users? 4. List 2 different variants of the Unix (not Linux) operating system, as well as their corresponding vendor (the company that developed them) ?...
Write a C program that accepts a port number as a command line argument, and starts...
Write a C program that accepts a port number as a command line argument, and starts an HTTP server. This server should constantly accept() connections, read requests of the form: GET /path HTTP/1.1\r\n\r\n read the file indicated by /path, and send it over the "connect" file descriptor returned by the call to accept().
Ubuntu Linux HW5: text processing; scripting 1. Write a Linux command to rewrite the /var/passwd file...
Ubuntu Linux HW5: text processing; scripting 1. Write a Linux command to rewrite the /var/passwd file to have a tab for each delimiter ':'. Hint: use tr 2. Write a Linux command to extract the user names and sort them. Hint: use cut 3. Write a for loop to to display a time table, e.g., 17 x 1 = 17; 17 x 2 = 34; etc., as follows: 17 x 1 = 17 17 x 2 = 34 17 x...
USING COMMAND PROMPT ON LINUX. show how... Linux Users, Groups, and Permissions Lab Objective: Understand how...
USING COMMAND PROMPT ON LINUX. show how... Linux Users, Groups, and Permissions Lab Objective: Understand how to create user accounts Understand how to create group accounts Creating good password policies Understanding permissions and file sharing Setup: You will need a Ubuntu Server VM Walk Through: You are a system administrator who has been tasked to create user accounts for new users on your system. You can pick whatever theme you like as long as there are protagonist and antagonist users:...
Python Write a program that takes a text filename as command line argument, and prints number...
Python Write a program that takes a text filename as command line argument, and prints number of times each letter occurred in this file.
Write a python program that will take in the number of call minutes used. Your program...
Write a python program that will take in the number of call minutes used. Your program will calculate the amount of charge for the first 200 minutes with a rate of $0.25; the remaining minutes with a rate of $0.35. The tax amount is calculated as 13% on top of the total. The customer could have a credit that also has to be considered in the calculation process. Finally, the program displays all this information. Below is a sample run:...
In MongoDB using Linux how do you Execute the command to find the size of a...
In MongoDB using Linux how do you Execute the command to find the size of a single document of your choosing from the enron database Execute the command to find the size of the collection of documents in the enron database
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT