JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris 11.1 Administration: Oracle Solaris Zones, Oracle Solaris 10 Zones, and Resource Management     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

Part I Oracle Solaris Resource Management

1.  Introduction to Resource Management

2.  Projects and Tasks (Overview)

3.  Administering Projects and Tasks

4.  Extended Accounting (Overview)

5.  Administering Extended Accounting (Tasks)

6.  Resource Controls (Overview)

7.  Administering Resource Controls (Tasks)

Administering Resource Controls (Task Map)

Setting Resource Controls

How to Set the Maximum Number of LWPs for Each Task in a Project

How to Set Multiple Controls on a Project

Using the prctl Command

How to Use the prctl Command to Display Default Resource Control Values

How to Use the prctl Command to Display Information for a Given Resource Control

How to Use prctl to Temporarily Change a Value

How to Use prctl to Lower a Resource Control Value

How to Use prctl to Display, Replace, and Verify the Value of a Control on a Project

Using rctladm

How to Use rctladm

Using ipcs

How to Use ipcs

Capacity Warnings

How to Determine Whether a Web Server Is Allocated Enough CPU Capacity

8.  Fair Share Scheduler (Overview)

9.  Administering the Fair Share Scheduler (Tasks)

10.  Physical Memory Control Using the Resource Capping Daemon (Overview)

11.  Administering the Resource Capping Daemon (Tasks)

12.  Resource Pools (Overview)

13.  Creating and Administering Resource Pools (Tasks)

14.  Resource Management Configuration Example

Part II Oracle Solaris Zones

15.  Introduction to Oracle Solaris Zones

16.  Non-Global Zone Configuration (Overview)

17.  Planning and Configuring Non-Global Zones (Tasks)

18.  About Installing, Shutting Down, Halting, Uninstalling, and Cloning Non-Global Zones (Overview)

19.  Installing, Booting, Shutting Down, Halting, Uninstalling, and Cloning Non-Global Zones (Tasks)

20.  Non-Global Zone Login (Overview)

21.  Logging In to Non-Global Zones (Tasks)

22.  About Zone Migrations and the zonep2vchk Tool

23.  Migrating Oracle Solaris Systems and Migrating Non-Global Zones (Tasks)

24.  About Automatic Installation and Packages on an Oracle Solaris 11.1 System With Zones Installed

25.  Oracle Solaris Zones Administration (Overview)

26.  Administering Oracle Solaris Zones (Tasks)

27.  Configuring and Administering Immutable Zones

28.  Troubleshooting Miscellaneous Oracle Solaris Zones Problems

Part III Oracle Solaris 10 Zones

29.  Introduction to Oracle Solaris 10 Zones

30.  Assessing an Oracle Solaris 10 System and Creating an Archive

31.  (Optional) Migrating an Oracle Solaris 10 native Non-Global Zone Into an Oracle Solaris 10 Zone

32.  Configuring the solaris10 Branded Zone

33.  Installing the solaris10 Branded Zone

34.  Booting a Zone, Logging in, and Zone Migration

Glossary

Index

Setting Resource Controls

How to Set the Maximum Number of LWPs for Each Task in a Project

This procedure adds a project named x-files to the /etc/project file and sets a maximum number of LWPs for a task created in the project.

  1. Become root or assume an equivalent role.
  2. Use the projadd command with the -K option to create a project called x-files. Set the maximum number of LWPs for each task created in the project to 3.
    # projadd -K 'task.max-lwps=(privileged,3,deny)' x-files
  3. View the entry in the /etc/project file by using one of the following methods:
    • Type:

      # projects -l
      system
              projid : 0
              comment: ""
              users  : (none)
              groups : (none)
              attribs: 
      .
      .
      .
      x-files
              projid : 100
              comment: ""
              users  : (none)
              groups : (none)
              attribs: task.max-lwps=(privileged,3,deny)
    • Type:

      # cat /etc/project
      system:0:System:::
      .
      .
      .
      x-files:100::::task.max-lwps=(privileged,3,deny)

Example 7-1 Sample Session

After implementing the steps in this procedure, when the root user creates a new task in project x-files by joining the project with newtask, the user will not be able to create more than three LWPs while running in this task. This is shown in the following annotated sample session.

# newtask -p x-files csh

# prctl -n task.max-lwps $$
process: 111107: csh
NAME    PRIVILEGE    VALUE    FLAG   ACTION            RECIPIENT
task.max-lwps
        usage            3
        privileged       3       -   deny                      -
        system       2.15G     max   deny                      -
# id -p
uid=0(root) gid=1(other) projid=100(x-files)

# ps -o project,taskid -p $$
 PROJECT TASKID
 x-files    73

# csh        /* creates second LWP */

# csh        /* creates third LWP */

# csh        /* cannot create more LWPs */
Vfork failed
#

How to Set Multiple Controls on a Project

The /etc/project file can contain settings for multiple resource controls for each project as well as multiple threshold values for each control. Threshold values are defined in action clauses, which are comma-separated for multiple values.

  1. Become root or assume an equivalent role.
  2. Use the projmod command with the -s and -K options to set resource controls on project x-files:
    # projmod -s -K 'task.max-lwps=(basic,10,none),(privileged,500,deny);
    process.max-file-descriptor=(basic,128,deny)' x-filesone line in file

    The following controls are set:

    • A basic control with no action on the maximum LWPs per task.

    • A privileged deny control on the maximum LWPs per task. This control causes any LWP creation that exceeds the maximum to fail, as shown in the previous example How to Set the Maximum Number of LWPs for Each Task in a Project.

    • A limit on the maximum file descriptors per process at the basic level, which forces the failure of any open call that exceeds the maximum.

  3. View the entry in the file by using one of the following methods:
    • Type:

      # projects -l
      .
      .
      .
      x-files
              projid : 100
              comment: ""
              users  : (none)
              groups : (none)
              attribs: process.max-file-descriptor=(basic,128,deny)
                       task.max-lwps=(basic,10,none),(privileged,500,deny) one line in file
    • Type:

      # cat /etc/project
      .
      .
      .
      x-files:100::::process.max-file-descriptor=(basic,128,deny);
      task.max-lwps=(basic,10,none),(privileged,500,deny) one line in file