Linux basic process and job management (II.)

Source: Internet
Author: User
Tags terminates

Linux process and Job management (2)


CentOS 6:http://172.16.0.1/fedora-epel/

CentOS 7:http://172.16.0.1/fedora-epel/

Process Management class Commands:

Htop command:

Options:

-D #: Specify the delay interval;

-U UserName: Displays only the process of the specified user;

-S Colume: Sort by the specified field;

Sub-command:

L: Displays the list of files opened by the selected process;

S: Tracks system calls for the selected process;

T: Show the status of each process in a hierarchical relationship;

A: Binds the selected process to a specified CPU core;

Vmstat command:

-Report Virtual Memory statistics

Vmstat [Options] [delay [count]]

Procs:

R: The number of processes waiting to run; the queue length of the task waiting to run on the CPU;

B: The number of processes in the non-interruptible sleep state; the length of the blocked task queue;

Memory

SWPD: Total swap memory usage;

Free: The total amount of physical memory available;

Buffer: The total amount of memory used for buffer;

Cache: The total amount of memory used for the cache;

Swap

SI: Data rate for data entry into swap (KB/S)

So: the rate at which data leaves swap (kb/s)

Io

BI: The speed at which data is read from a block device to the system (KB/S)

Bo: The rate at which data is saved to a block device (KB/S)

System

In:interrupts, interrupt rate;

Cs:context switch, the rate of context switching;

Cpu

Us:user Space

Sy:system

Id:idle

Wa:wait

St:stolen

Options:

-S: Displays memory statistics;

PMAP command:

-Report Memory map of a process

PMAP [options] pid [...]

-X: Displays detailed format information;

Another way to view: Cat/proc/pid/maps

Glances command:

-A cross-platform curses-based monitoring Tool

Built-in commands:

Common options:

-B: Displays the online data rate in bytes;

-D: Turn off the disk I/O module;

-M: Close the Mount module;

-N: Close the network module;

-T #: Refresh time interval;

-1: The relevant data for each CPU is displayed separately;

-O {html| CSV}: Output format;

-f/path/to/somedir: Set the location of the output file;

Run the glances command in C/s mode:

Service mode:

Glances-s-B ipaddr

IPADDR: An address of this machine for listening;

Client mode:

Glances-c ipaddr

IPADDR: Is the address of the remote server;

Dstat command:

-Versatile tool for generating system resource statistics

Dstat [-AFV] [options:] [Delay [Count]]

Common options:

-C,--CPU: Display CPU-related information;

-C #,#,..., Total

-D,--disk: Displays information about the disk

-D sda,sdb,..., Tobal

-G: Displays page-related rate data;

Related statistics for-m:memory

Relevant statistics of-n:interface;

-P: Displays the relevant statistics of the process;

-R: Displays the relevant statistics for the IO request;

-S: Displays the relevant statistics of swapped;

--tcp

--udp

--raw

--socket

--ipc

--TOP-CPU: Displays the most CPU-intensive processes;

--top-io: The most IO-intensive process;

--top-mem: The most memory-intensive process;

--top-lantency: the most deferred process;

Kill command:

-Terminate a process

Used to send signals to the process to achieve the management of the process;

Show current system available signals:

Kill-l [Signal]

There are three ways to identify each signal:

1) Digital identification of the signal;

2) The full name of the signal;

3) The abbreviated name of the signal;

Signal to process:

Kill [-S signal|-signal] pid ...

Common signals:

1) SIGHUP: No need to close the process and let it reread the configuration file;

2) SIGINT: Terminates the running process, which is equivalent to CTRL + C

9) SIGKILL: Kill the running process;

SIGTERM: Termination of the running process;

Sigcont):

SIGSTOP):

Killall command:

-Kill processes by name

Killall [-signal] Program

Linux System Job Control:

Job

Front-end operation (Foregroud): Through the terminal start, and after the start will occupy the terminal;

Background Job (Backgroud): Can be launched through the terminal, but after the boot into the background to run (release terminal);

How do I get my job running in the background?

(1) Operations in operation

CTRL + Z

Note: After sending to the backstage, the job will be switched to a stop state;

(2) Jobs that have not been started

# COMMAND &

Note: While this type of job is sent backstage, it is still relevant to the terminal, if you want to take the jobs sent back to the backend with the terminal relationship:

# Nohup COMMAND &

To view all jobs:

# jobs

Common commands to implement job control:

# FG [[%]job_num]: Bring the assigned assignment back to the foreground;

# BG [[%]job_num]: Let the job sent backstage continue to run in the background;

# Kill%job_num: Terminates the specified job;

To adjust the process priority level:

Priority ranges that can be adjusted with the nice value: 100-139

Corresponds to:-20, 19, respectively

When the process starts, its nice value defaults to 0, and its priority is 120;

Nice command:

Starts and runs the command with the specified nice value

# Nice [OPTION] [COMMAND [ARGU] ...]

Options:

-N Nice

Note: Only the administrator can adjust the nice value down;

Renice command:

# Renice [-n] Nice PID ...

View nice values and priorities:

PS Axo pid, NI, priority, comm

Commands not involved: SAR, Tsar, Iostat, Iftop, Nethog, ...

Blog assignment: The use of HTOP/DSTAT/TOP/PS commands;


Linux basic process and job management (II.)

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.