Linux Process Management Tool II

Source: Internet
Author: User
Tags terminates

We discussed the PS command, top and htop tools in the previous section, and we discussed how several other tools were used.

1.vmstat command:
Vmstat [Options] [delay [count]]

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/0E/wKioL1XzqzHASWdyAAEb3ipmhPc180.jpg "title=" 246. PNG "alt=" wkiol1xzqzhaswdyaaeb3ipmhpc180.jpg "/>
Procs:
R: The number of processes waiting to run;
B: The number of processes in the non-interruptible sleep state, (length of blocked queue);
Memory
SWPD: Total amount of swap memory used;
Free: The total amount of idle physical memory;
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: Data rate from swap (KB/S)
Io:
BI: The rate at which data is read into the system from the block device; (kb/s)
Bo: The rate at which data is saved to a block device;
System
In:interrupts, interrupt rate;
Cs:context switch, process switching rate;
Cpu:usPercentage of user space programs occupied

The percentage of Sy kernel space occupied

ID is idle,wa waits for the time occupied by io to complete

The time the St was stolen by virtualization technology

Options:
-S: Show memory statistics

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/73/11/wKiom1XzqZGTRYNXAADWRzy3kr8927.jpg "title=" 247. PNG "alt=" wkiom1xzqzgtrynxaadwrzy3kr8927.jpg "/>

2. Pmap command: Show memory and process mappings
Pmap-report memory Map of a process

PMAP [options] pid [...]
-X: Displays detailed format information;
Another implementation:
# Cat/proc/pid/maps

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/73/0E/wKioL1Xzrz-QDWeTAAGKimBVIVk413.jpg "title=" 248. PNG "alt=" wkiol1xzrz-qdwetaagkimbvivk413.jpg "/>

3.glances command:

glances [-BDEHMNRSVYZ1] [-B bind] [-C Server] [-C conffile] [-P port] [-p password] [--password] [-t refresh] [-f file] [- O Output]

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/73/0E/wKioL1Xzswbj_ZPKAAKQdUvqmug932.jpg "title=" 249. PNG "alt=" wkiol1xzswbj_zpkaakqduvqmug932.jpg "/>

Built-in commands:
A Sort processes automatically l Show/hide logs
C Sort processes by CPU% b Bytes or bits for network I/O
M Sort processes by mem% W Delete warning logs
P Sort processes by name X Delete Warning and critical logs
I Sort processes by I/O rate 1 Global CPU or PER-CPU stats
d show/hide disk I/o stats h show/hide
F show/hide File system stats T View network I/O as combination
n show/hide Network stats u View Cumulative network I/O
s show/hide Sensors stats Q Quit (ESC and ctrl-c also work)
Y show/hide hddtemp Stats

Common options:
-B: Displays the network card data rate in bytes;
-D: Turn off the disk I/O module;
-f/path/to/somefile: Set the input file location;
-O {html| CSV}: Output format;
-M: Disable Mount Module
-N: Disable network module
-T #: Delay time interval
-1: The relevant data for each CPU is displayed separately;

Run the glances command in C/s mode:
Service mode:
Glances-s-B ipaddr
IPADDR: Indicates which address is listening on this machine

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/73/11/wKiom1Xzs9OjgDbFAAA-MxW9NVY462.jpg "title=" 250. PNG "alt=" wkiom1xzs9ojgdbfaaa-mxw9nvy462.jpg "/>

Client mode:
Glances-c ipaddr
IPADDR: Server-side address to connect to

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/11/wKiom1Xzs9_A-ffRAAK5bIwOaZQ005.jpg "title=" 251. PNG "alt=" wkiom1xzs9_a-ffraak5biwoazq005.jpg "/>

4.dstat command: Dynamically generate system resource statistics
Dstat [-AFV] [options:] [Delay [Count]]

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/11/wKiom1XztHezcUbqAAFJ0dk8B8Y070.jpg "title=" 252. PNG "alt=" wkiom1xzthezcubqaafj0dk8b8y070.jpg "/>

-C: Display CPU-related information;
-C #,#,..., Total
-D: Display disk related information;
-D Total,sda,sdb,...

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/73/0F/wKioL1XzuFLwg2m6AADhziGRPRw388.jpg "title=" 253. PNG "alt=" wkiol1xzuflwg2m6aadhzigrprw388.jpg "/>

-G: Display page related statistics;
-M: Display memory related statistics;
-N: Display network related statistics;
-P: Show process-related statistics;
-R: Displays statistics related to IO requests;
-S: Displays swapped related statistics;
--tcp
--udp
--unix
--raw
--socket
--ipc
--TOP-CPU: Displays the most CPU-intensive processes;
--top-io: Shows the process that most consumes IO;
--top-mem: Shows the most memory-intensive processes;
--top-lantency: Shows the process with the most delay;

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/73/0F/wKioL1XzuZWyDhJoAAC81MUh5eU856.jpg "title=" 254. PNG "alt=" wkiol1xzuzwydhjoaac81muh5eu856.jpg "/>

5.kill command: Send a control signal to the process for process management, typically for killing processes

     show current system available signals:
        # kill-l
         # Man 7 signal
     Common signals:
         1) SIGHUP: No need to close the process to reread the configuration file;
        2) SIGINT: Aborts a running process, equivalent to CTRL + C;
        9) SIGKILL: kills a running process;
         15) SIGTERM: terminates a running process;
         18) Sigcont:
        19) SIGSTOP:
     Method of specifying the signal:
         (1) Digital identification of the signal; 1, 2, 9
          (2) signal full name; SIGHUP
         (3) abbreviated name of the signal; HUP
      signal to process:
        kill [-signal] PID ...

See HTTPD service is running:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/0F/wKioL1XzvRTSELAmAAFAKzZIJEQ610.jpg "style=" float: none; "title=" 255.png "alt=" Wkiol1xzvrtselamaafakzzijeq610.jpg "/>

Terminate all processes under "name":
Killall [-signal] Program

After the signal is sent, the HTTPD service is terminated:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/11/wKiom1XzuuSCBSsMAAHESUd55Kw953.jpg "style=" float: none; "title=" 256.png "alt=" Wkiom1xzuuscbssmaahesud55kw953.jpg "/>

6.Linux Job Control
     foreground job: Start with terminal and Occupy terminal after startup;
     Background job: Can be started by terminal, But when it starts, it goes back to the background (releasing the terminal);
     How do I get jobs to run in the background?
         (1) Jobs in operation
             ctrl+z
         (2) Jobs not yet started
             # COMMAND &
This type of job is sent to the background, but it is still related to the terminal ; If you want to send to the background, peel off the relationship with the terminal:
# nohup COMMAND &

     View all jobs:
         # jobs
     Job Control:
         # FG [[%]job_num]: The designated background work is recalled to the foreground;
        # BG [[%]job_num] : Allow jobs sent to the background to continue running in the background;
        # kill [%job_num]: terminates the specified job;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/0F/wKioL1XzvwOgDEc-AAEaRICeSQw761.jpg "title=" 257. PNG "alt=" wkiol1xzvwogdec-aaearicesqw761.jpg "/>

7. Process Priority adjustment:
Static priority: 100-139

The nice value is 0 when the process is started by default, and the priority level is 120;
Nice command: To modify the process priority with nice, this process must not be running in advance
Nice [OPTION] [COMMAND [ARG] ...]

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/73/0F/wKioL1XzwOSwByFDAAAZrVEqads804.jpg "title=" 258. PNG "alt=" wkiol1xzwoswbyfdaaazrveqads804.jpg "/>

Renice command:
Renice [-n] Priority pid ...

Renice-n 2 3386 (PID)

View:
PS Axo Pid,comm,ni

This article is from the "After Tomorrow" blog, please be sure to keep this source http://leeyan.blog.51cto.com/8379003/1694068

Linux Process Management Tool II

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.