首页 > 系统服务 > 详细

Monitoring and Managing Linux Processes

时间:2015-08-28 21:03:25      阅读:191      评论:0      收藏:0      [点我收藏+]
Overview
Goal To evaluate and control processes running on a Lunix system
Objectives
  • List and interpret basic information about processes running on the system
  • Control processes in the shell? session using bash job control
  • Terminate and control porcesses using singnals
  • Moniror resource usage and system load due to process activity
Sections
  • Processes
  • Controlling Jobs
  • Killing Processes
  • Monitoring Process Activity
Lab Monitoring and Managing Linux Process

 

Section 1: Process

What is process?

A process is a running instance of a launched, executable program. A process consists of:

  • an address space of allocated memory,
  • secuirty properties including ownership credentials and privileges
  • one or more execution threads of program code, and
  • the process state.

 

An existing(Parent) process duplicates its own address space(fork) to create a new(child) process structure. Every new process is assigned a unique process ID(PID) for tracking and security. The PID and the Parents? Process ID(PPID) are elements of the new process enviroment. All processes are descendants of the first system process, systemd.

 

Linux process States
Name Flag Kernel-defined state name and description
Running R TASK_RUNNING: The process is either executing on a CPU or waiting to run. Process can be executing user routines or kernel routines(system calls), or be queued and ready when in the Running(or Runnable) state.
Sleeping S TASK_INTERRUPTIBLE:
D TASK_UNINTERRUPTIBLE
K TASK_KILLABLE
Stopped T TASK_STOPPED
T TASK_TRACKED
Zombie Z EXIT_ZOMBIE
X EXIT_DEAD

 

 

 

 

 

 

 

 

 

Listing processes

the ps command is used for listing current processes. The command can provide detailed process infomation, include:

  • the UID which determines process privileges
  • PID
  • the CPU and real time already expended
  • how much memory the process has allocated in various locations
  • the location of process STDOUT, known as the controlling terminal, and
  • the current process state

 

Note: The linux version of ps supports three option formats, including:

  • UNIX(POSIX) options
  • BSD options
  • GNU long options

for example, ps -aux not the same as ps aux

技术分享

 

技术分享

Monitoring and Managing Linux Processes

原文:http://www.cnblogs.com/elewei/p/4767696.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!