Detailed Description: Process Management for Linux operating systems

Source: Internet
Author: User
Article Title: Details: Process Management for Linux operating systems. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

1. programs and processes

A program is a software designed to complete a task. For example, OpenOffice is a program. What is a process? A process is a running program.

A running program may have multiple processes. For example, LinuxSir. the WWW server used by Org is an apache server. When the Administrator starts the service, many people may access it. That is to say, many users request the httpd service at the same time, the apache server will create multiple httpd processes to serve them.

1.1 process classification;

Processes are generally divided into three types: interaction process, batch processing process, and daemon process.

It is worth mentioning that the daemon process is always active and generally runs in the background. The daemon process is generally started by the system automatically activated by the script or by the super administrator root at startup. For example, in Fedora or Redhat, we can define the running level of the startup script of the httpd server. This file is located in/etc/init. in the d directory, the file name is httpd,/etc/init. d/httpd is the daemon of the httpd server. When the running level is set to 3 and 5, it starts when the system starts.

[Root @ localhost ~] # Chkconfig -- level 35 httpd on

Because the daemon is always running, the status of the daemon is waiting for the request to be processed. For example, whether we access the httpd servers of LinuxSir. Org and LinuxSir. Org is running, waiting for the user to access, that is, waiting for the task to be processed.

1.2 process attributes;

Process ID (PID): A unique value used to differentiate processes;

The ID (PPID) of the parent process and the parent process );

The User ID (UID) of the Startup Process and the group (GID) of the startup process );

Process status: the status can be run R, sleep S, or zombie Z;

Priority of process execution;

The terminal name that the process is connected;

Process resource usage: for example, the resource usage (memory and CPU usage );

1.3 Parent and Child processes;

Their relationship is the relationship between management and management. When the parent process is terminated, the child process also terminates. But the child process is terminated, and the parent process is not necessarily terminated. For example, when the httpd server is running, we can kill its child processes. The parent process will not be terminated because of the termination of the child process.

In process management, when we find that a process that occupies too many resources or cannot be controlled, we should kill it to protect the stable and secure operation of the system;

2. Process Management

Linux Process Management is implemented through process management tools, such as ps, kill, and pgrep;

2.1 ps process monitoring tool;

Ps provides a one-time View of the process. The results are not dynamically consecutive. If you want to monitor the process time, you should use the top tool;

[1] [2] [3] [4] [5] [6] Next page

Related Article

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.