Solaris system to view and manage the process

2010-08-14  来源:本站原创  分类:OS  人气:165 

http://www.blogjava.net/envoydada/archive/2008/06/11/207028.html
1 What is the process?
Process: the implementation of the procedures can be complicated by some process of data collection on the run. Resource allocation process is the basic unit is the basic unit of scheduling and distribution.

2, UNIX operating system process scheduling algorithm:
Multi-level feedback queue scheduling algorithm.

3, the process state: to create the initial, ready (active, inactive), implementation, block (active, inactive), the end.

4, process control commands:
ps command, and process tools / usr / proc / bin under the Tools class.
Ps and grep command can be used in combination to search for specific information.
5, / usr / proc / bin commands Description:
pstop stop the process
prun pid restart the process
ptime pid process using micro-state calculation of the time
pwait pid to wait for the specified process to terminate.
pcred pid show credibility
pfiles pid display is on file in the fstat and fcntl information
pflags pid display each lwp's / proc tracing flags, waiting and holding semaphores, and other state information
pldd pid display links to each process in the dynamic link library
pmap pid shows address mapping space
psig pid operation display signal
pstack pid hexadecimal display each lwp stack trace with symbols
ptree pid shows the process tree containing the specified PID
pwdx oid shows the current working directory

6, ps command format:
ps [-aAdeflcjLPy] [-o format] [-t termlist] [-u userlist] [-U userlist] [-G grouplist] [-p proclist] [-g pgrplist] [-s sidlist]

7, commonly used parameters:
-E all processes output report
-F process in the first column shows the name of the owner (not the UID). This option is closed-l,-t,-s and-r option, open the-a option.
-L output to generate a long report, but does not contain the STIME field

8, ps-el to explain the relevant output parameters:
bash-2.05 $ ps-el

FS UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
19 T 0 0 0 0 0 SY? 0? 0:16 sched
8 S 0 1 0 0 40 20? 151?? 0:00 init
19 S 0 2 0 0 0 SY? 0?? 0:00 pageout
19 S 0 3 0 0 0 SY? 0?? 0:30 fsflush
8 S 0 377 1 0 40 20? 223?? 0:00 sac
8 S 0 378 1 0 40 20? 224? Console 0:00 ttymon
8 S 0 131 1 0 40 20? 289?? 0:00 rpcbind

F hex signs, which add up to the current state of that process. As follows:
00 process terminates, and they are in the process table space has been released.
01 system processes, memory resident
02 process is the parent process of tracking
04 process is the parent process to track and has been stopped
08 The process can not be awakened semaphore
10 The process currently in memory, and is locked until the completion of an event
Process can not be exchanged out of 20

S current status of the process, one of the following letter shows:
O is currently running on a processor
S sleep; waiting for I / O event to complete
Run the end of R
I idle; process is created
Z dead. Process has been terminated
T as the parent process to track and stop
X waiting for more memory

UID process owner user ID
PID process ID
PPID parent process ID
C process CPU usage (that is, the process of accounting for the percentage of CPU time)
PRI process priority programs. Larger number indicates a lower priority
NI process nice value associated with the priority program. To a process "nicer" means lowering the process priority, so that it does not exhaust CPU time
SZ process of the virtual memory. This is the system memory requirements of a good indicator.
TTY boot process (or parent) of the terminal. Process with no controlling terminal question mark (usually a system process)
TIME CPU since the process was initiated in accounting for the amount of time
COMD process orders generate

9, using the ps report.
Find a user belongs to many of the same work. Kill command to terminate the process. ps-U username
TIME field to find a lot of CPU time occupied by the process. This process may be endless loop. ps-e
Find C field, to identify important but take up a lot of CPU time to process. If the process for too much memory, delete the process. If many processes taking up a lot of memory, the system may need to increase memory. ps-el
Note that using more and more CPU time the process out of control. By using the-f option to see the process start time (STIME) and by looking at the TIME field in the total amount of CPU time to detect runaway processes. ps-f

10, the removal process.
Until the end of the normal channels can not use the Delete command.
# Kill - signal pid
signal: 57
signal:
2 interrupt
3 Exit
4 illegal instruction
5 trace interrupt
6 Abort
7 EMT instruction (Emulation competition trap)
8 floating point format exceptions
9 kill (can not be caught or ignored)
10-channel error
Memory section 11 is not legitimate
12 Error system call
13 channels connected to write unreadable
14 alarm clock
Signal the end of 15 software
16 user-defined signal 1
17 user-defined signal 2
18 child process status is changed
19 power supply broken
20 window (Window) size is changed
21Urgent (emergency) Socket Condition
22 Pollable (searchable) event
23 stop
24 by the end user
25 continue
Stop input terminal 26
27 stop terminal output
28 virtual Timer expired
29 Profiling time expired
CPU time more than 30
31 more than the file size limit
32 Socket I / O possible

Sometimes the use kill command, but the process has not been deleted. Most likely in three ways:
Process before exiting to wait for equipment to complete the operation.
The process of waiting for failure as a result of NFS can not use resources. To remove such a process, type kill-quit PID
Process, the process for the dead, defunct in ps report the news in the show. Dead process is freed all resources, but did not receive confirmation of the process the parent process. Only receive a confirmation to delete the process in the process table entry. Dead the next boot process will be cleared. Dead process does not affect system performance, do not delete.

11, priority control can be ordered using the priocntl command:
Display or set scheduling parameters specified process scheduler display system configuration information for the implementation of the current scheduling parameters with the specified command for each process has a different level, each level has its own distribution of the different scheduling strategies.
System may be configured in the class include:
System (SYS)
Interactive (IA)
Real-time (RT)
Fractional share (TS)
For fractional share class, the priority range of users: -20 ~ +20. The priority of a time-sharing process (user mode priority) is inherited from the parent process. System in the time-table to find the user-mode scheduling priority, to include any
nice value or values that are priocntl priority (users) to ensure the creation of global priority between 0 and 59.
In the default configuration, a real-time process running before any other processes running. Real-time process, improper use can cause system performance degradation.
1. Show the basic information process level (process level or system scheduling parameters):
Enter priocntl-l and press Enter
2. Shows the global process priority using the ps-ecl command to display the process of global priority. Global priority listed in the PRI column
3, specify the process priority:
Enter priocntl-e-c class-m user-limit-p priority command - name Enter
-E execute the command
-C specified level (default is TS (time sharing) or RI (real time)
-M user limit option, specify the-p option to raise or lower the priority of the maximum amount.
-P allows you to specify the priority of users, the range of -20 ~ +20.

4. To change the scheduling parameters of time-sharing process in accordance with the following steps to change the time-sharing process scheduling parameters:
1) a super user.
2) Input priocntl-s-m user-limit [-p priority]-i id type id-list Enter.
-S allows to set the user priority limit the scope of
-M user limit option, specify the-p option to raise or lower the priority of the maximum amount.
-P priority command name option allows you to specify the priority.
-I id-type and the id-list option to use the id-type and the id-list of the combination of identification process, id -
type specified id type, such as PID or UID.
3) Enter the ps-ecl | grep id-list Enter.
4) Check the PRI field of the output, verify that the process has been successfully changed state.
% Priocntl-s-c RT-t 500-p 20 myprog
% Ps-ecl | grep myprog

5. Change the process in accordance with the following steps to change the process level:
1) a super user.
2) Input priocntl-s-c class-i id type id-list Enter.
-S allows to set the user priority range and change the priority ceiling
-C specifies the process to change the level for the TS (time sharing) level or RI (real) level
-I id-type and the id-list option to use the id-type and the id-list of the combination of identification process, id-type id specified
Type, such as PID or UID.
3) Enter the ps-ecl | grep id-list Enter.
4) Check the PRI field of the output, verify that the process has been successfully changed state.
Note: You must be super-user or to operate in real-time shell, change the process-level class for non-real-time or real-time level.

6, change the process priority using the nice command to increase or decrease the priority of a command or process.
Use the command without parameters, the default nice value by 4 units, so that lower priority process.
Note: must be superuser to.
/ Usr / bin / nice command-name (the default, the priority of the process decreased by 4 units)
/ Usr / bin / nice +10 command-name (process priority reduced by 10 units)
/ Usr / bin / nice -10 command-name (process priority an increase of 10 units)
/ Usr / bin / nice - -10 command-name (nice value by 10 units, increased by one order of priority)

相关文章
  • Solaris system to view and manage the process 2010-08-14

    http://www.blogjava.net/envoydada/archive/2008/06/11/207028.html 1 What is the process? Process: the implementation of the procedures can be complicated by some process of data collection on the run. Resource allocation process is the basic unit is t

  • Solaris system will approach the process into the background 2010-08-26

    Solaris system will approach the process into the background Problem description: Solaris system in the process of transfer will be running in the background Solution: Transfer process in solaris will run in the background are two cases, one is not a

  • unix / linux system to view the process of memory, Linux 2011-07-25

    unix / linux system to view process memory Abstract: This paper describes the time process management concepts and process management tools introduced; paper focuses on the process management tool for the classification description and application ex

  • raw device and solaris partition and view the hard disk format 2010-12-09

    # Format ==== view has been articulated on the hard disk == Searching for disks ... done AVAILABLE DISK SELECTIONS: 0. C0d0 <DEFAULT cyl 7293 alt 2 hd 255 sec 63> / Pci @ 0,0 / pci-ide @ 1f, 2/ide @ 0/cmdk @ 0,0 1. C2t1d0 <DEFAULT cyl 157 alt 2 h

  • Linux System Information View orders Encyclopaedia (2) 2010-03-25

    Linux System Information View orders Daquan Linux command line recently read some articles, the system learned a lot of information view the area command. Think wrote before in a matter of fact that Linux is more simple to use , found that the system

  • Solaris system performance monitoring of two 2011-01-17

    Solaris System Performance Monitoring II: control your network traffic (snoop & netstat) Published: 2009-5-04 09:28 | Author: Zee | Source: 7 Test network snoop packet capture solaris snoop packet capture tool comes, focus on all data streams # Snoop

  • In the Solaris system with zones installed, add and remove software packages 2011-02-11

    Chapter 26 in the Solaris system with zones installed, add and remove packages and patches (task) Solaris 10 1 / 06: In this release, this chapter has been completely revised. This chapter describes the installation of a non-global zones on the lates

  • View solaris system parameters 2010-08-05

    See physical memory using prtconf, # Prtconf-vp | grep Mem 1. View disk space df-hk 2. Look at memory echo:: memstat | mdb-k Page Summary Pages MB% Tot ---- ------ ------ - Kernel 1863974 7281 22% Anon 2153163 8410 26% Exec and libs 20649 80 0% Page

  • solaris system the size of a folder to view the command 2011-06-15

    # Du-sk / export / logs / 241311 / export / logs That folder / export / logs / size of 241311B, namely 241311/1024 = 235.7MB.

  • Transfer: solaris system command Introduction 2010-10-22

    Transfer: http://www.tianall.com/BBS/Topic.asp?ID=376 quota-v View your available disk space (unit: KB) and the file number ⊙ date is the date, time ⊙ who find the current and you are using the same machine and the login time and place who find the c

  • Linux operating system in view of all users 2010-04-22

    1, Linux in view of all users in linux, and not like the windows of the net user, net localgroup these commands to manage user convenience. Xwindows interface, not said. (1) in the terminal. In fact, only need to check the / etc / passwd file on the

  • Linux System Information View orders Daquan 2010-07-22

    Author charlee, the original link http://tech.idv2.com/2008/01/11/linux-sysinfo-cmds/ System # uname -a # See kernel / operating system /CPU Information # head -n 1 /etc/issue # View operating system version # cat /proc/cpuinfo # View CPU Information

  • View port into the process 2010-08-06

    : ~ / Workspace / xiaonei_api_console $ sudo netstat-nap | grep 8080 tcp6 0 0::: 8080::: * LISTEN 5745/java : ~ / Workspace / xiaonei_api_console $ kill 5745 Found in 8080 the port has been opened using the above command to see a moment process And t

  • View the current apache process number and the number of concurrent access 2010-08-20

    1, see apache current number of concurrent access: netstat-an | grep ESTABLISHED | wc-l Contrast httpd.conf MaxClients number gap in the number. 2, see how many number of processes: ps aux | grep httpd | wc-l 3, you can view the data using the follow

  • View information on the process of memory for cpu, Linux command-TOP 2010-09-28

    We use the top command to view CPU usage. top does not produce output, the display remains unchanged. It refreshes the screen to display the new information. So, if you only perform and keep the screen always on top, the screen always displays the la

  • Linux System information view the command 2010-10-20

    # Uname-a # See kernel / operating system / CPU Information # Head-n 1 / etc / issue # View operating system version # Cat / proc / cpuinfo # View CPU Information View the computer name # hostname # # Lspci-tv # list all PCI devices # Lsusb-tv # list

  • Linux System information view 2010-11-26

    From / proc / cpuinfo for CPU information from the file / proc / meminfo file get memory information from / proc / ioports file for input / output port information from / proc / partitions file for hard disk partition information from / proc / stat f

  • Linux System information view the command Daquan 2010-11-30

    Original link: http://tech.idv2.com/2008/01/11/linux-sysinfo-cmds/ System # uname -a # See kernel / operating system /CPU Information # head -n 1 /etc/issue # View operating system version # cat /proc/cpuinfo # View CPU Information # hostname # View

  • Turn: solaris system commands Profile 2010-10-22

    Turn: http://www.tianall.com/BBS/Topic.asp?ID=376 quota-v look at their free disk space (unit: KB) and the number of files ⊙ date the current date, time, queries ⊙ who use the same machine now and you who have the time and place ⊙ w and login on the

  • DOS view port, get the process path 2011-08-18

    How to check the port occupancy? Start - Run - cmd into the command prompt type netstat-ano to see all the connections after the PID in Task Manager to find the PID corresponding to the Task Manager program if it is not a PID, in the task Manager sel