JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Managing System Information, Processes, and Performance in Oracle Solaris 11.1     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Managing System Information (Tasks)

2.  Managing System Processes (Tasks)

What's New in Managing System Processes

Pseudo System Processes

Managing System Processes

Managing System Processes (Task Map)

Commands for Managing System Processes

Using the ps Command

Using the /proc File System and Commands

Managing Processes by Using Process Commands (/proc)

How to List Processes

How to Display Information About Processes

How to Control Processes

Terminating a Process (pkill, kill)

How to Terminate a Process (pkill)

How to Terminate a Process (kill)

Debugging a Process (pargs, preap)

Managing Process Class Information

Managing Process Class Information (Task Map)

Changing the Scheduling Priority of Processes (priocntl)

How to Display Basic Information About Process Classes (priocntl)

How to Display the Global Priority of a Process

How to Designate a Process Priority (priocntl)

How to Change Scheduling Parameters of a Timesharing Process (priocntl)

How to Change the Class of a Process (priocntl)

Changing the Priority of a Timesharing Process (nice)

How to Change the Priority of a Process (nice)

Troubleshooting Problems With System Processes

3.  Monitoring System Performance (Tasks)

4.  Scheduling System Tasks (Tasks)

5.  Managing the System Console, Terminal Devices, and Power Services (Tasks)

Index

Managing Process Class Information

The following list identifies the process scheduling classes that can be configured on your system. Also included is the user priority range for the timesharing class.

The possible process scheduling classes are as follows:

Managing Process Class Information (Task Map)

Task
Description
For Instructions
Display basic information about process classes.
Use the priocntl -l command. to Display process scheduling classes and priority ranges.
Display the global priority of a process.
Use the ps -ecl command to display the global priority of a process.
Designate a process priority.
Start a process with a designated priority by using the priocntl -e -c command.
Change scheduling parameters of a timesharing process.
Use the priocntl -s -m command to change scheduling parameters in a timesharing process.
Change the class of a process.
Use the priocntl -s -c command to change the class of a process.
Change the priority of a process.
Use the /usr/bin/nice command with the appropriate options to lower or raise the priority of a process.

Changing the Scheduling Priority of Processes (priocntl)

The scheduling priority of a process is the priority assigned by the process scheduler, according to scheduling policies. The dispadmin command lists the default scheduling policies. For more information, see the dispadmin(1M) man page.

You can use the priocntl command to assign processes to a priority class and to manage process priorities. For instructions on using the priocntl command to manage processes, see How to Designate a Process Priority (priocntl).

How to Display Basic Information About Process Classes (priocntl)

Example 2-4 Displaying Basic Information About Process Classes (priocntl)

The following example shows output from the priocntl -l command.

# priocntl -l
CONFIGURED CLASSES
==================

SYS (System Class)

TS (Time Sharing)
        Configured TS User Priority Range: -60 through 60

FX (Fixed priority)
        Configured FX User Priority Range: 0 through 60

IA (Interactive)
        Configured IA User Priority Range: -60 through 60

How to Display the Global Priority of a Process

Example 2-5 Displaying the Global Priority of a Process

The following example shows ps -ecl command output. The values in the PRI column show the priority for each process.

$ ps -ecl
 F S    UID   PID  PPID  CLS PRI     ADDR     SZ    WCHAN TTY         TIME CMD
 1 T      0     0     0  SYS  96        ?      0          ?         0:11 sched
 1 S      0     5     0  SDC  99        ?      0        ? ?         0:01 zpool-rp
 0 S      0     1     0   TS  59        ?    688        ? ?         0:00 init
 1 S      0     2     0  SYS  98        ?      0        ? ?         0:00 pageout
 1 S      0     3     0  SYS  60        ?      0        ? ?         2:31 fsflush
 1 S      0     6     0  SDC  99        ?      0        ? ?         0:00 vmtasks
 0 S     16    56     1   TS  59        ?   1026        ? ?         0:01 ipmgmtd
 0 S      0     9     1   TS  59        ?   3480        ? ?         0:04 svc.star
 0 S      0    11     1   TS  59        ?   3480        ? ?         0:13 svc.conf
 0 S      0   162     1   TS  59        ?    533        ? ?         0:00 pfexecd
 0 S      0  1738  1730   TS  59        ?    817        ? pts/ 1       0:00 bash
 0 S      1   852     1   TS  59        ?    851        ? ?         0:17 rpcbind
 0 S     17    43     1   TS  59        ?   1096        ? ?         0:01 netcfgd
 0 S     15    47     1   TS  59        ?    765        ? ?         0:00 dlmgmtd
 0 S      0    68     1   TS  59        ?    694        ? ?         0:01 in.mpath
 0 S      1  1220     1   FX  60        ?    682        ? ?         0:00 nfs4cbd
 0 S     16    89     1   TS  59        ?   1673        ? ?         0:02 nwamd
 0 S      0   146     1   TS  59        ?    629        ? ?         0:01 dhcpagen
 0 S      1   129     1   TS  59        ?   1843        ? ?         0:00 kcfd
 0 S      1  1215     1   FX  60        ?    738        ? ?         0:00 lockd
 0 S      0   829   828   TS  59        ?    968        ? ?         0:00 hald-run
 0 S      0   361     1   TS  59        ?   1081        ? ?         0:01 devfsadm
 0 S      0   879     1   TS  59        ?   1166        ? ?         0:01 inetd
 0 O 119764  1773   880   TS  59        ?    557          cons ole     0:00 ps
 0 S      0   844   829   TS  59        ?    996        ? ?         0:00 hald-add
 0 S      0   895   866   TS  59        ?    590        ? ?         0:00 ttymon
 0 S      0   840     1   TS  59        ?    495        ? ?         0:00 cron
 0 S      0   874     1   TS  59        ?    425        ? ?         0:00 utmpd
 0 S      0  1724   956   TS  59        ?   2215        ? ?         0:00 sshd
 0 S 119764   880     9   TS  59        ?    565        ? cons ole     0:00 csh
 0 S      0   210     1   TS  59        ?   1622        ? ?         0:00 sysevent
 0 S      0   279     1   TS  59        ?    472        ? ?         0:00 iscsid
 0 S      1  1221     1   TS  59        ?   1349        ? ?         0:00 nfsmapid
 1 S      0   374     0  SDC  99        ?      0        ? ?         0:00 zpool-us
 0 S      0  1207     1   TS  59        ?   1063        ? ?         0:00 rmvolmgr
 0 S      0   828     1   TS  59        ?   1776        ? ?         0:03 hald
 0 S      0   853   829   TS  59        ?    896        ? ?         0:02 hald-add
 0 S      0   373     1   TS  59        ?    985        ? ?         0:00 picld
 0 S      0   299     1   TS  59        ?    836        ? ?         0:00 dbus-dae
 0 S  12524  1730  1725   TS  59        ?    452        ? pts/ 1       0:00 csh
 0 S      0   370     1   TS  59        ?    574        ? ?         0:00 powerd
 0 S      0   264     1   FX  60        ?    637        ? ?         0:00 zonestat
 0 S      0   866     9   TS  59        ?    555        ? ?         0:00 sac
 0 S      0   851   829   TS  59        ?    998        ? ?         0:00 hald-add
 0 S  12524  1725  1724   TS  59        ?   2732        ? ?         0:00 sshd
 0 S      1  1211     1   TS  59        ?    783        ? ?         0:00 statd
 0 S      0  1046     1   TS  59        ?   1770        ? ?         0:13 intrd
 0 S      0   889     1   TS  59        ?   1063        ? ?         0:00 syslogd
 0 S      0  1209     1   TS  59        ?    792        ? ?         0:00 in.ndpd
 0 S      0  1188  1186   TS  59        ?    951        ? ?         0:15 automoun
 0 S      0  1172   829   TS  59        ?    725        ? ?         0:00 hald-add
 0 S      0  1186     1   TS  59        ?    692        ? ?         0:00 automoun
 0 S    101  1739  1738   TS  59        ?    817        ? pts/ 1       0:00 bash
 0 S      0  1199     1   TS  59        ?   1495        ? ?         0:02 sendmail
 0 S      0   956     1   TS  59        ?   1729        ? ?         0:00 sshd
 0 S     25  1192     1   TS  59        ?   1528        ? ?         0:00 sendmail
 0 S      0   934     1   TS  59        ?   6897        ? ?         0:14 fmd
 0 S      0  1131     1   TS  59        ?   1691        ? ?         0:07 nscd
 0 S      1  1181     1   TS  59        ?    699        ? ?         0:00 ypbind
 

How to Designate a Process Priority (priocntl)

  1. Assume the root role.

    See How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Start a process with a designated priority.
    # priocntl -e -c class -m user-limit -p pri command-name
    -e

    Executes the command.

    -c class

    Specifies the class within which to run the process. The valid classes are TS (timesharing), RT (real time), IA (interactive), FSS (fair share), and FX (fixed priority).

    -m user-limit

    When you use the -p option with this option, the maximum amount you can raise or lower your priority is also specified.

    -p pri command-name

    Enables you specify the relative priority in the RT class for a real-time thread. For a timesharing process, the -p option lets you specify the user-supplied priority, which ranges from -60 to +60.

  3. Verify the process status.
    # ps -ecl | grep command-name

Example 2-6 Designating a Process Priority (priocntl)

The following example shows how to start the find command with the highest possible user-supplied priority.

# priocntl -e -c TS -m 60 -p 60 find . -name core -print
# ps -ecl | grep find

How to Change Scheduling Parameters of a Timesharing Process (priocntl)

  1. Assume the root role.

    See How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Change the scheduling parameters of a running timesharing process.
    # priocntl -s -m user-limit [-p user-priority] -i idtype idlist
    -s

    Lets you set the upper limit on the user priority range and change the current priority.

    -m user-limit

    When you use the -p option, specifies the maximum amount you can raise or lower the priority.

    -p user-priority

    Allows you to designate a priority.

    -i xidtype xidlist

    Uses a combination of xidtype and xidlist to identify the process or processes. The xidtype specifies the type of ID, such as the process ID or the user ID. Use xidlist to identify a list of process IDs or user IDs.

  3. Verify the process status.
    # ps -ecl | grep idlist

Example 2-7 Changing Scheduling Parameters of a Timesharing Process (priocntl)

The following example shows how to execute a command with a 500-millisecond time slice, a priority of 20 in the RT class, and a global priority of 120.

# priocntl -e -c RT -m 500 -p 20 myprog
# ps -ecl | grep myprog

How to Change the Class of a Process (priocntl)

  1. (Optional) Assume the root role.

    See How to Use Your Assigned Administrative Rights in Oracle Solaris 11.1 Administration: Security Services.

  2. Change the class of a process.
    # priocntl -s -c class -i idtype idlist
    -s

    Lets you set the upper limit on the user priority range and change the current priority.

    -c class

    Specifies the class, TS for time-sharing or RT for real-time, to which you are changing the process.

    -i idtype idlist

    Uses a combination of xidtype and xidlist to identify the process or processes. The xidtype specifies the type of ID, such as the process ID or user ID. Use xidlist to identify a list of process IDs or user IDs.


    Note - You must assume the root role or be working in a real-time shell to change a process from, or to, a real-time process. If, as root, you change a user process to the real-time class, the user cannot subsequently change the real-time scheduling parameters by using the priocntl -s command.


  3. Verify the process status.
    # ps -ecl | grep idlist

Example 2-8 Changing the Class of a Process (priocntl)

The following example shows how to change all the processes that belong to user 15249 to real-time processes.

# priocntl -s -c RT -i uid 15249
# ps -ecl | grep 15249

Changing the Priority of a Timesharing Process (nice)

The nice command is only supported for backward compatibility to previous releases. The priocntl command provides more flexibility in managing processes.

The priority of a process is determined by the policies of its scheduling class and by its nice number. Each timesharing process has a global priority. The global priority is calculated by adding the user-supplied priority, which can be influenced by the nice or priocntl commands, and the system-calculated priority.

The execution priority number of a process is assigned by the operating system. The priority number is determined by several factors, including the process's scheduling class, how much CPU time it has used, and in the case of a timesharing process, its nice number.

Each timesharing process starts with a default nice number, which it inherits from its parent process. The nice number is shown in the NI column of the ps report.

A user can lower the priority of a process by increasing its user-supplied priority. However, only superuser can lower a nice number to increase the priority of a process. This restriction prevents users from increasing the priorities of their own processes, thereby monopolizing a greater share of the CPU.

The nice numbers range from 0 to +39, with 0 representing the highest priority. The default nice value for each timesharing process is 20. Two versions of the command are available: the standard version, /usr/bin/nice, and the C shell built-in command.

How to Change the Priority of a Process (nice)

Using this procedure, a user can lower the priority of a process. However, the root role can raise or lower the priority of a process.

  1. Determine whether you want to change the priority of a process, either as a user or as superuser. Then, select one of the following:
    • As a user, follow the examples in Step 2 to lower the priority of a command.
    • As a superuser, follow the examples in Step 3 to raise or lower priorities of a command.
  2. As a user, lower the priority of a command by increasing the nice number.

    The following nice command executes command-name with a lower priority by raising the nice number by 5 units.

    $ /usr/bin/nice -5 command-name

    In the preceding command, the minus sign designates that what follows is an option. This command could also be specified as follows:

    $ /usr/bin/nice -n 5 command-name

    The following nice command lowers the priority of command-name by raising the nice number by the default increment of 10 units, but not beyond the maximum value of 39.

    $ /usr/bin/nice command-name
  3. As superuser, raise or lower the priority of a command by changing the nice number.

    The following nice command raises the priority of command-name by lowering the nice number by 10 units, but not below the minimum value of 0.

    # /usr/bin/nice --10 command-name

    In the preceding command, the first minus sign designates that what follows is an option. The second minus sign indicates a negative number.

    The following nice command lowers the priority of command-name by raising the nice number by 5 units, but not beyond the maximum value of 39.

    # /usr/bin/nice -5 command-name

See Also

For more information, see the nice(1) man page.