Sunday, April 14, 2013

Resource Pool Management

The purpose of resource pools is to segregate different workloads to eliminate their contention for certain types of resources. Resource pools allow persistent configuration for workload processor set and scheduler assignments.

Pools can operate on the following types of elements:

  • system: The system as a whole
  • pool: Define resource pools
  • pset: Processor sets.
  • cpu: Single processor.

Each project can have a project.pool attribute set in /etc/project in order to assign a resource pool. This would be set by a command of the following form:
projmod -a -K project.pool=poolname project-name

Dynamic resource pools are implemented via the poold daemon. poold can only execute in the global zone.

The default static pools configuration file is /etc/pooladm.conf. If this file exists, its configuration is applied at boot time.

The poolcfg command operates on a configuration file, though poolcfg -d may be used to modify the current kernel state. pooladm is used to activate the pool configuration contained in a file or to display information about the configuration currently in the kernel.

To enable a configuration, run:
pooladm -e To instantiate the configuration in a file, run:
pooladm -c filename
To dump the active configuration to a file, run:
pooladm -s filename
To disable pools, run
pooladm -d
To display the pool configuration in a "nice" format, run:
poolcfg -c info

poolstat can be used to display information on resource pools. If executed from a non-global zone, however, it will only display information for the pool assigned to that zone.

Multiple non-global zones can be associated with a particular resource pool. When this is done, processes from within one of these zones cannot be assigned to a different resource pool via poolbind, even when the attempt is made from the global zone.

poold Properties

The following are the property names for poold:

  • system.poold.log-level: Logging level
  • system.poold.log-location: Log location
  • system.poold.monitor-interval: Sampling interval
  • system.poold.history-file: Decision history
  • pset.max: Maximum CPUs for a pset.
  • pset.min: Minimum CPUs for a pset.
  • cpu.pinned: (true/false) Whether the CPU is pinned.
  • system.poold.objectives: System objectives.
  • pset.poold.objectives: Pset objectives.
  • pool.importance: User-assigned importance of a pool.
  • pool.scheduler: Defines scheduler to be used by a pool.

These are assigned with poolcfg. For example, to assign a pool to a scheduler, run:
poolcfg -c 'modify pool pool-name (string pool.scheduler="scheduler-initials ")'

poold Configuration: Constraints and Objectives

Minimum and maximum numbers of processors available to a processor set can be set with the pset.min and pset.max properties. The cpu.pinned property indicates that a particular CPU should not be moved out of its processor set.

The libpool man page contains detailed information on property constraints.

Configuration objectives define the behavior of poold. The available objectives are:

  • wt-load: The weighted-load objective provides pooled resources based on the weight of the active objects. It is a system-wide objective.
  • locality: locality is defined on a pset. It defines how much weight is given to the closeness of available resources. It can be assigned values of tight (maximize locality), loose (minimize locality) or none (not taken into account-default).
  • utilization: This is defined to be greater than (>), less than (<) or about (~) some percentage of utilization for a pset. The > and < operators can be used to set a range, but ~ must be used alone if at all.

The objectives are also set with poolcfg:
poolcfg -c 'modify system system-name (string system.poold.objectives="objective "),

If wt-load is set, note that the psets need to have "locality none" set as an objective.

Processor Sets

Each processor can belong to only one processor set at a time. The default processor set is created when poold is enabled. It cannot be destroyed.

To create a processor set with a range of possible numbers of CPUs, run:
poolcfg -c 'create pset pset-name (uint pset.min = min-cpus; unit pset.max = max-cpus)'
To create a pool, run:
poolcfg -c 'create pool pool-name'
To associate a pool and a pset, run:
poolcfg -c 'associate pool pool-name (pset pset-name)'
To apply the changes, run:
pooladm -c

To transfer processors between processor sets, run:
poolcfg -dc 'transfer number-procs from pset pset-source to pset-target'

Additional Reading

Additional information is available in Sun's System Administration Guide: Solaris Containers-Resource Management and Solaris Zones.

No comments: