JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Oracle Solaris Zones, Oracle Solaris 10 Containers, and Resource Management     Oracle Solaris 11 Express 11/10
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, Halting, Uninstalling, and Cloning Non-Global Zones (Overview)

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

20.  Non-Global Zone Login (Overview)

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

22.  Moving and Migrating Non-Global Zones (Tasks)

23.  About Packages on an Oracle Solaris 11 Express System With Zones Installed

24.  Oracle Solaris Zones Administration (Overview)

25.  Administering Oracle Solaris Zones (Tasks)

26.  Troubleshooting Miscellaneous Oracle Solaris Zones Problems

Part III Oracle Solaris 10 Zones

27.  Introduction to Oracle Solaris 10 Zones

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

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

30.  Configuring the solaris10 Branded Zone

31.  Installing the solaris10 Branded Zone

32.  Booting a Zone and Zone Migration

33.  solaris10 Branded Zone Login and Post-Installation Configuration

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. Be superuser or have the required rights profile.
  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 superuser creates a new task in project x-files by joining the project with newtask, superuser 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. Be superuser or have the required rights profile.
  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