Unix/linux System Automation Management: Process Management Chapter

Source: Internet
Author: User
Tags memory usage sleep cpu usage linux

Introduction: This is a unix/linux system Management Automation series, mainly about how to achieve automated monitoring process status and performance and timely notify the system administrator.

Process monitoring is a very important part of unix/linux system management. It can monitor the process status, CPU utilization of the process, and so on, and can send alarm information to the system administrator or make a specific response when the process is found to be abnormal. We can use System process monitoring information for reasonable process scheduling to optimize system performance, or adjust the behavior of the system according to these information.

The commands for different operating system monitoring processes may be slightly different. This article introduces the Unix/linux operating system process management commands and related information, and discusses the automated scripting implementation of process monitoring on the Unix/linux operating system.

Introduction to Unix/linux Process Management related commands

A process is an entity that the operating system uses to control system resources. Unix/linux process Management related commands are mainly the following, in the subsequent implementation of the script will use some of the commands.

Show Process Properties command

PS Command: This command is the most basic and very powerful process view command for reporting process identities, users, CPU time consumption, and other attributes. It can be used to determine which processes are running and running, whether the process is over, if the process is dead, which processes are consuming too many resources, and so on. The PS command monitors the work of the background process, because the background process does not communicate with the standard input/output devices on the on-screen keyboard, and if it needs to be detected, use the PS command.

The list of processes that are seen by using the PS command alone is a process executed at the foreground, but not all processes are performed in the foreground, and many processes are hidden behind the scenes. Use command ps-e to display all processes.

Process Performance Detection commands

Top command: Linux Displays the CPU occupancy rate as the first few processes using the command. This command sorts tasks by CPU usage, memory usage, and execution time, and many of the commands can be set in interactive commands or in personal custom files. The top primary field has the following meanings:

Table 1. Top field meaning

Column Name Meaning
Pid Process ID
USER User name of the process owner
PR Task priority
NI Nice value. A smaller number indicates higher precedence, and a larger number indicates a lower priority
Virt Total amount of virtual memory used by the process in kilobytes: KB. Virt=swap+res
Res The amount of physical memory that the process is using, not swapped out, in kilobytes: KB. Res=code+data
Shr Shared memory size, in kilobytes: KB
S Process status.
D= an uninterrupted sleep state
R= Run
S= Sleep
t= Tracking/Stopping
z= Zombie Process
%cpu Percentage of CPU time that was last updated to now
time+ Total CPU time used by the process, accurate to 1/100 seconds
COMMAND Command name/command line

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.