RM for Zones
en

RM for Zones

NOTE: The rm project is no longer active on this website so information here may be out of date. Current Oracle Solaris 11 product documentation can be found here. Information about downloading Oracle Solaris 11 can be found here.

Resource Management for Zones

Zones can be bound to a Resource Pool, as well as have Resource Controls added.

Binding a Zone to a Resource Pool

A Resource Pool can be used to control the number of cpus on which a zone runs.
In the future, Resource Pools will also support partitioning Physical Memory and Swap.  Multiple zones may be bound to the same pool, or each zone may be bound to a unique pool, or some combination thereof.  The only restriction is that a non-global zone may not be bound to, or span, more than one Resource Pool.

A zone's pool binding is specified by setting the "pool" property.
When the zone is booted, the "pool" property is applied.

Examples:

Configuring a zone to bind to a pool upon boot:

    # zonecfg -z zone1
    zonecfg:zone1> set pool=pool1
    zonecfg:zone1> exit
    # zoneadm -z zone1 reboot

Binding a running zone to a pool:

    # poolbind -p pool1 -i zoneid zone1

Use poolcfg(1m) and pooladm(1m) to create pool1.  See Resource Pools.

Setting Resource Controls on a Zone


Resource controls may be set on a zone to limit it's consumption of
system resources.  Current resource controls are are:

  • zone.max-lwps
  • Limits the number of user threads that may be created by a zone.  Since each process contains at least one user thread, this also limits the number of processes running in a zone.
  • zone.cpu-shares
  • Governs the quantity of cpu that may be consumed by the zone relative to other zones bound to the same pool.  For instance, two zones bound to the same pool, each with the same number of shares, will consume the pool's cpus equally when the system is 100 percent busy.

Examples:

  • Setting zone.max-lwps to limit the number of threads in a zone to 100:
    # zonecfg -z zone1
    zonecfg:zone1> add rctl
    zonecfg:zone1:rctl> set name=zone.max-lwps
    zonecfg:zone1:rctl> add value (priv=privileged,limit=100,action=deny)
    zonecfg:zone1:rctl> end
    zonecfg:zone1> exit
    # zoneadm -z zone1 reboot
  • Or, after using zonecfg to configure the resource control, prctl(1) can be used to set the resource control on the running zone, avoiding the need to reboot it:
    # zonecfg -z zone1
    zonecfg:zone1> add rctl
    zonecfg:zone1:rctl> set name=zone.max-lwps
    zonecfg:zone1:rctl> add value (priv=privileged,limit=100,action=deny)
    zonecfg:zone1:rctl> end
    zonecfg:zone1> exit
    # prctl -s -n zone.max-lwps -v 100 -t priv -e deny -i zone zone1

If the zone already has a zone.max-lwps resource control set, then replace it:

    # zonecfg -z zone1
    zonecfg:zone1> select rctl name=zone.max-lwps
    zonecfg:zone1:rctl> remove value (priv=privileged,limit=100,action=deny)
    zonecfg:zone1:rctl> add value (priv=privileged,limit=200,action=deny)
    zonecfg:zone1:rctl> end
    zonecfg:zone1> exit
    # prctl -r -n zone.max-lwps -v 200 -i zone zone1

Future Work

  • Additional Resource Controls that may be added in the future:
  • zone.max-locked-memory
    • Limiting the quantity of physical memory that may be locked by a zone.
  • zone.max-processes
    • Limiting the number of processes (including zombies) that a zone may have.
  • zone.cpu-cap
    • Limiting the absolute quantity of cpu a zone may consume.  For instance, A zone may be limited to consuming half of a cpu.
  • System V Resource Controls.
    • Limits various system V objects such as shared memory, message queues, and semaphores.
  • Usability/Feature Enhancements
  • A mechanism for configuring resource controls and a pool binding for the global zone.
  • A mechanism for setting the default resource controls for all zones.
  • Simplified zonecfg syntax for setting resource controls.

Documentation

Tags:
Created by admin on 2009/10/26 12:17
Last modified by admin on 2009/10/26 12:17

Collectives


XWiki Enterprise 2.7.1.34853 - Documentation