AIX Process Management

Source: Internet
Author: User

1. process description

In AIX, a process is a task, and a running program is a process.


2. child and parent Processes

A process can be dependent on a process. A process can generate a new process. The generated process is called a child process, and the original process is called a parent process.


3. View Processes

Ps: process view command

In the ps command, you can view the UID user ID of the process, PID process ID), PPID parent process ID), Ccpu utilization), STIME start time), and TTY console) TIME running TIME), CMD command) and so on.

$ Ps-f

UID PID PPID C STIME TTYTIME CMD

Xumin 15044 26436 0 17:17:15 pts/1-ksh

Xumin 27412 15044 6 17:18:04 pts/1 0: 00 ps-f


4. foreground and background processes

1) Foreground Process

When a foreground process is running, you must wait until the current process ends before running the next process.

Foreground process running mode:

$ Command

2) background process

When a background process is running, you can run the next process without waiting for the completion of the current background process.

Background process running mode:

$ Command &


5. Improve process priority

1) nice: You can increase the nice value and reduce the process priority.

$ Nice [-lncrement |-n lncrement]

2) renice: You can add nice values to reduce the priority of processes.


6. Terminate the process

1) Foreground Process

Ctrl-c: Terminate the current foreground Process

Kill: Terminate the specified foreground process.

2) background process

Kill: terminate a specified background process.

3) kill usage

$ Kill [-Signalnumber |-Signalname] Processes

Frequently used:

$ Kill ProcessesID

$ Kill-9 ProcessesID

ProcessesID is the process number, which can be obtained using the ps command


7. run long processes

Nohup: enables the background process to run when the user exits the system. If no nohup is specified, the output information will be saved in nohup. out.

$ Nohup command &

$ Nohup ls-R /&


8. Process Control in shell Environment

<Ctrl-z>: Pause the foreground process.

Jobs: displays background processes and paused processes.

Fg: The paused process continues.

Bg: continue the paused process and run it in the background.

Specify a process in bg, fg, or kill. % jobnumber is required, and jobnumber can be obtained by jobs.


9. deamons, a background resident program

Deamon is a process that never stops. It is usually used to manage and control system resources, such as qdeamon printing management), cron scheduled running of specified programs, and errdeamon error management.


10. Display/modify process attributes

The attributes of a process include the ID of the process, the ID of the parent process, the running time, the name and priority of the executed program.


11. display process attributes

To display the properties of a process, run the ps command. AIX supports all AT&T and BSD ps commands.

To use the BSD style, simply remove the minus sign of the command option, for example:

# Ps alx

The AT&T version of the command above is:

# Ps-elf

In the ps command output, PRI and NI indicate the priority of the process. Nice is part of the priorities value. The value range of priorities is 0 ~ 127. The lower the value, the more often the process is scheduled for execution. The higher the value, the lower the priority.


12. Modify the process priority

To change the priority of a process, run the nice command. The nice command can be followed by 0 ~ 39. The higher the value, the lower the priority. Nice commands have two syntaxes: nice-Increment and nice-n Increment ). When a negative value is required, the latter can be used. If no value is specified, nice increases by 10 by default. The following command increases the priority of 10 for a command.

# Nice-10 CommandName command name)

The following commands reduce the priority of a command by 10

# Nice CommandName

The renice command also provides the-n option. Renice Syntax:

# Renice Priority-p PID

If no other options are specified,-p is optional.


13. Stop the process

AIX uses the kill command to stop the process. AIX has two kill commands:/usr/bin/kill and shell built-in command kill. The two commands can use different semaphores. Semaphores are used to notify the process to perform corresponding actions. For example, the TERM signal is to force the process to exit, while the HUP is to force the process to suspend. You can use kill-l to display available semaphores.

# Kill-l

AIX also has the killall command, which can be used by any user to kill all processes except the processes sent.

Syntax:

# Killall-Signal


14. Performance Testing

The purpose of process management is to improve the system running performance. Therefore, we must first check the current system running performance and analyze the bottleneck of the system performance. AIX supports standard UNIX commands such as topas, sar, vmstat, and iostat.

Topas

Dynamic Refresh is used to display system performance information, including: top-level processes of the system, average system status burden), number of memory used and released, and single process status activated on the system. Compared with ps commands, ps commands only give "snapshots" of the system at a certain time point, while topas displays system information and their changes at a certain interval.

Sar

Displays the accumulated system activity information, including CPU utilization, buffer activity, Data Reading and reading from the device, terminal activity, the number of system calls in use, the number of exchanges, and the queue length, there are other core information.

Vmstat

Quantitatively displays the number of virtual storages used by system processes, as well as traps and CPU activity information.

Iostat

Count the I/O of hard disks, terminals, and processors.


15. timed start of a process

You can use the cron waiting process to start the process at a scheduled time. The crontab file used by the process is in the/var/spool/cron/crontabs directory, with the username as the file name, for example, the crontab file of the root user is root. AIX supports the AT&T crontab file, each of which contains the following formats:

Minute 0 to 59)

Hours 0 to 23)

1 to 31)

1 to 12 a year)

The day of the week is 0 to 6, from Saturday to Sunday)

Shell commands

AIX can also directly call the crontab command. The crontab command has the-e option, which loads the crontab content to the editing environment. The EDITOR used depends on the EDITOR variable value. Once the file is saved and exited from the editing environment, the new crontab file will change and take effect immediately.

Normally, the crontab spool directory is defined in/var/spool/cron. In addition, AIX has a connection from/usr/spool to/var/spool, which is used by the operating system to maintain compatibility with previous versions.


Oracle video tutorial follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html

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.