Improved Resource Management and Zones Integration

 Starting with Solaris Express Community Edition build 56, improved zonecfg procedures for creating containers are available. It is easier to leverage the resource management capabilities provided by the system when you create a zone. The zonecfg command can now be used to configure temporary pools, memory limits, the default scheduling class for the zone, and rctl aliases. The resource configuration you specify is automatically created for you when the zone boots. You no longer have to perform any manual steps related to setting up resource management.

The zonecfg command can also be used to configure the resource management settings for the global zone.

rcapd has been enhanced so that it can now cap a zone's physical memory consumption. You can use rcapd from the global zone to regulate physical memory consumption in non-global zones. Both rcapd and prstat have been enhanced to determine an accurate value for RSS.

The new functionality is available for both Solaris (native) zones and Linux branded zones.


Ability to Use zonecfg in the Global Zone

zonecfg can now be used in the global zone to persistently specify resource management settings for the global zone.

Ability to Specify Zone-Wide Resource Controls as Global Property Names

You can now configure zone-wide controls using the set global_property_name subcommand of zonefig instead of using the rctl resource. The following zone-wide resource controls are available.

  • zone.cpu-shares (preferred: cpu-shares)
  • zone.max-locked-memory (The locked property of the capped-memory resource is the preferred way to set this control.)
  • zone.max-lwps (preferred: max-lwps)
  • zone.max-msg-ids (preferred: max-msg-ids)
  • zone.max-sem-ids (preferred: max-sem-ids)
  • zone.max-shm-ids (preferred: max-shm-ids)
  • zone.max-shm-memory (preferred: max-shm-memory)
  • zone.max-swap (The swap property of the capped-memory resource is the preferred way to set this control.)

Global Property Usage Example

zonecfg:my-zone> **set cpu-shares=5**

Scheduling Class

You can use the fair share scheduler (FSS) to control the allocation of available CPU resources among zones, based on their importance.

When you explicitly set the new cpu-shares property, the fair share scheduler (FSS) will be used as the scheduling class for that zone. However, the preferred way to use FSS is to set FSS to be the system default scheduling class with the dispadmin command, so all zones will benefit from getting a fair share of the system CPU resources. If cpu-shares is not set for a zone, the zone will use the system default scheduling class. The following actions set the scheduling class for a zone:

  • You can use the new scheduling-class property in zonecfg to set the scheduling class for the zone.
  • You can set the scheduling class for a zone through the resource pools facility. If the zone is associated with a pool that has its pool.scheduler property set to a valid scheduling class, then processes running in the zone run in that scheduling class by default.
  • If the new cpu-shares rctl is set and FSS has not been set as the scheduling class for the zone through another action, zoneadmd sets the scheduling class to FSS when the zone boots.
  • If the scheduling class is not set through any other action, the zone inherits the system default scheduling class.

scheduling-class Property Usage

Set the scheduling class to FSS.

zonecfg:my-zone> **set scheduling-class=FSS**

Physical Memory Control and the capped-memory Resource

The capped-memory resource sets limits for physical, swap, and locked memory. Each limit is optional, but at least one must be set.

  • Determine values for this resource if you plan to cap memory for the zone by using rcapd from the global zone. The physical property of the capped-memory resource is used by rcapd as the max-rss value for the zone.
  • The swap property of the capped-memory resource is the preferred way to set the zone.max-swap resource control.
  • The locked property of the capped-memory resource is the preferred way to set the zone.max-locked-memory resource control.

capped-memory Resource Usage Example

Specify the memory limits for the zone my-zone. Each limit is optional, but at least one must be set.

zonecfg:my-zone> **add capped-memory**
zonecfg:my-zone:capped-memory> **set physical=50m**
zonecfg:my-zone:capped-memory> **set swap=100m**
zonecfg:my-zone:capped-memory> **set locked=30m**
zonecfg:my-zone:capped-memory> **end**

dedicated-cpu Resource

 You can specify that a subset of the system's processors be dedicated to a non-global zone while it is running by using the new dedicated-cpu resource. The system will dynamically create a temporary pool for use while the zone is running.

Note: The dedicated-cpu resource is incompatible with the cpu-shares rctl and the pool property.

dedicated-cpu Resource Usage Example

The dedicated-cpu resource sets limits for number of CPUs, and optionally, the relative importance of the pool.

The following example specifies a CPU range for use by the zone my-zone.

zonecfg:my-zone> **add dedicated-cpu**
zonecfg:my-zone:dedicated-cpu> **set ncpus=1-3**
zonecfg:my-zone:dedicated-cpu> **set importance=2**
zonecfg:my-zone:dedicated-cpu> **end**

 If you specify a range because you want dynamic resource pool behavior, also do the following:

  • Set the importance property.
  • Enable dynamic resource pools as described in "Enabling and Disabling the Pools Facility" in System Administration Guide: Solaris Containers--Resource Management and Solaris Zones on docs.sun.com.

clear Subcommand

This new subcommand is used to clear the value for optional settings. Required settings cannot be cleared. However, some required settings can be changed by assigning a new value.

clear Subcommand Usage Example

zonecfg:my-zone> clear pool

For More Information

 For more information, see System Administration Guide: Solaris ContainersResource Management and Solaris Zones.

Copyright 2007 Sun Microsystems, Inc.

last modified by admin on 2009/10/26 12:11
Collectives
Project


© Sun Microsystems Inc. 2009
XWiki Enterprise 1.8.2.19075 - Documentation
Terms Of Use | Privacy | Trademarks | Copyright Policy | Site Guidelines | Site map | Help
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.