System Administration Guide: Oracle Solaris Containers-Resource Management and Oracle Solaris Zones

Setting Zone-Wide Resource Controls

The global administrator can set privileged zone-wide resource controls for a zone. Zone-wide resource controls limit the total resource usage of all process entities within a zone.

These limits are specified for both the global and non-global zones by using the zonecfg command. See How to Configure the Zone.

Starting with the Solaris 10 8/07 release, the preferred, simpler method for setting a zone-wide resource control is to use the property name instead of the rctl resource.

Solaris 10 5/08: The zone.cpu-cap resource control sets an absolute limit on the amount of CPU resources that can be consumed by a zone. A value of 100 means 100 percent of one CPU as the project.cpu-cap setting. A value of 125 is 125 percent, because 100 percent corresponds to one full CPU on the system when using CPU caps.


Note –

When setting the capped-cpu resource, you can use a decimal number for the unit. The value correlates to the zone.capped-cpu resource control, but the setting is scaled down by 100. A setting of 1 is equivalent to a setting of 100 for the resource control.


The zone.cpu-shares resource control sets a limit on the number of fair share scheduler (FSS) CPU shares for a zone. CPU shares are first allocated to the zone, and then further subdivided among projects within the zone as specified in the project.cpu-shares entries. For more information, see Using the Fair Share Scheduler on a Solaris System With Zones Installed. The global property name for this control is cpu-shares.

The zone.max-locked-memory resource control limits the amount of locked physical memory available to a zone The allocation of the locked memory resource across projects within the zone can be controlled by using the project.max-locked-memory resource control. See Table 6–1 for more information.

The zone.max-lwps resource control enhances resource isolation by preventing too many LWPs in one zone from affecting other zones. The allocation of the LWP resource across projects within the zone can be controlled by using the project.max-lwps resource control. See Table 6–1 for more information. The global property name for this control is max-lwps.

The zone.max-msg-ids, zone.max-sem-ids, zone.max-shm-ids, and zone.max-shm-memory resource controls are used to limit System V resources used by all processes within a zone. The allocation of System V resources across projects within the zone can be controlled by using the project versions of these resource controls. The global property names for these controls are max-msg-ids, max-sem-ids, max-shm-ids, and max-shm-memory.

The zone.max-swap resource control limits swap consumed by user process address space mappings and tmpfs mounts within a zone. The output of prstat -Z displays a SWAP column. The swap reported is the total swap consumed by the zone's processes and tmpfs mounts. This value assists in monitoring the swap reserved by each zone, which can be used to choose an appropriate zone.max-swap setting.

Table 17–1 Zone-Wide Resource Controls

Control Name 

Global Property Name 

Description 

Default Unit 

Value Used For 

zone.cpu-cap

 

Solaris 10 5/08: Absolute limit on the amount of CPU resources for this zone.

Quantity (number of CPUs), expressed as a percentage 


Note –

When setting as the capped-cpu resource, you can use a decimal number for the unit.


 

zone.cpu-shares

cpu-shares

Number of fair share scheduler (FSS) CPU shares for this zone. 

Quantity (shares) 

 

zone.max-locked-memory

 

Total amount of physical locked memory available to a zone. 

If priv_proc_lock_memory is assigned to a zone, consider setting this resource control as well, to prevent that zone from locking all memory.

Size (bytes) 

locked property of capped-memory.

zone.max-lwps

max-lwps

Maximum number of LWPs simultaneously available to this zone. 

Quantity (LWPs) 

 

zone.max-msg-ids

max-msg-ids

Maximum number of message queue IDs allowed for this zone. 

Quantity (message queue IDs) 

 

zone.max-sem-ids

max-sem-ids

Maximum number of semaphore IDs allowed for this zone. 

Quantity (semaphore IDs) 

 

zone.max-shm-ids

max-shm-ids

Maximum number of shared memory IDs allowed for this zone. 

Quantity (shared memory IDs) 

 

zone.max-shm-memory

max-shm-memory

Total amount of System V shared memory allowed for this zone. 

Size (bytes) 

 

zone.max-swap

 

Total amount of swap that can be consumed by user process address space mappings and tmpfs mounts for this zone.

Size (bytes) 

swap property of capped-memory

These limits can be specified for running processes by using the prctl command. An example is provided in How to Set FSS Shares in the Global Zone Using the prctl Command. Limits specified through the prctl command are not persistent. The limits are only in effect until the system is rebooted.