Configuring CPU Resource Management on Zones

 

Usually CPU resource management on zones consists of assigning a CPU pool to one or more zones and managing the use of that pool with the Fair Share Scheduler (FSS). This set of instructions provides a recipe for that procedure for one simple zone.

 

The tasks to be performed, in order:

 

  1. Enable pool administration
  2. Create a processor set and assign CPUs to it
  3. Create a pool and place it under the control of the Fair Share Scheduler
  4. Assign the processor set to the CPU pool
  5. Configure the zone with a pool assignment and place its processes under the control of the Fair Share Scheduler.

 

In the following tasks, you will assign a CPU pool to a zone and configure Fair Share Scheduling on the CPU pool and on the zone. The pool contains one, and only one, processor set. Each zone can be assigned just one CPU pool, but a CPU pool may be shared among multiple zones, and also with the global zone. If a zone has exclusive use of a pool, you do not also need to configure Fair Share Scheduling (FSS) on the zone or enable FSS for the CPU pool but you may wish to in case you need to assign the CPU pool to an additional zone at a later time.

 

The global zone will use the "default" CPU pool, which is always configured, and contains the "default" processor set. The default processor set is assigned a minimum of one CPU and a maximum of 64k CPUs. You cannot unconfigure the default CPU pool or processor set, and the default processor set must always contain at least one CPU.

 

Prior to configuration, pool administration will be disabled.

 

# svcs pools

 

STATE          STIME    FMRI

disabled       15:45:32 svc:/system/pools:default

 

1. Enable pool administration:

 

# pooladm -e

 

 

Start pool administration. Depending on the release of Solaris 10, this may or may not start the daemon poold. It will always enable pool administration.

 

# svcs pools

 

STATE          STIME    FMRI

online          9:05:29 svc:/system/pools:default

 

# pooladm -n| more

 

OR

 

# poolcfg -dc info | more

 

You should see the default processor set, pset_default and the default pool pool_default. The processor set pset_default is assigned to pool_default, and it contains a minimum of one CPU and a maximum of all CPUs on the system. By default this number is 64k. CPUs are shown at the end of the output and are numbered 0 and up.

 
system maryann
        string  system.comment 
        int     system.version 1
        boolean system.bind-default true
        int     system.poold.pid 759
 
        pool pool_default
                int     pool.sys_id 0
                boolean pool.active true
                boolean pool.default true
                int     pool.importance 1
                string  pool.comment 
                pset    pset_default
 
        pset pset_default
                int     pset.sys_id -1
                boolean pset.default true
                uint    pset.min 1
                uint    pset.max 65536
                string  pset.units population
                uint    pset.load 651
                uint    pset.size 1
                string  pset.comment 
 
                cpu
                        int     cpu.sys_id 0
                        string  cpu.comment 
                        string  cpu.status on-line
                cpu
                        int     cpu.sys_id 1
                        string  cpu.comment 
                        string  cpu.status on-line

 

2. Configure a processor set. In this example the processor set is called pset1 and it has a minimum of one and a maximum of two CPUs. Any name and any maximum number of processors are acceptable. The total of all minimum numbers of processors, including the one processor in the default processor set, must not exceed the number of processors on the system. Once your processor set minimum CPU assignments equal the number of processors on the system, you will not be allowed to create another processor set.

 

# poolcfg -dc 'create pset pset1 (uint pset.min=1; uint pset.max=2)'

 

This processor set has a minimum of one and a maximum of two processors. The maximum number of processors is flexible, but the total of all minimum processor set assignments may not exceed the number of processors on the system, including the default processor set's assignment.

 

# poolcfg -dc info | more

 

You should see pset1 configured with one processor minimum and two maximum.

 
system maryann
        string  system.comment 
        int     system.version 1
        boolean system.bind-default true
        int     system.poold.pid 759
 
        pool pool_default
                int     pool.sys_id 0
                boolean pool.active true
                boolean pool.default true
                int     pool.importance 1
                string  pool.comment 
                pset    pset_default
 
        pset pset_default
                int     pset.sys_id -1
                boolean pset.default true
                uint    pset.min 1
                uint    pset.max 65536
                string  pset.units population
                uint    pset.load 182
                uint    pset.size 1
                string  pset.comment 
 
        pset pset1
                int     pset.sys_id -2
                boolean pset.default false
                uint    pset.min 1
                uint    pset.max 2
                string  pset.units population
                uint    pset.load 0
                uint    pset.size 0
                string  pset.comment 
 
                cpu
                        int     cpu.sys_id 0
                        string  cpu.comment 
                        string  cpu.status on-line
                 cpu
                        int     cpu.sys_id 1
                        string  cpu.comment 
                        string  cpu.status on-line
 

 

If you have made a mistake, return the pools to the default configuration:

 

# pooladm -x

 

Otherwise, proceed to the next task.

 

3. Configure a pool and place its processes under the control of the FSS. In this example the pool is called pool1, but any name is acceptable.

 

# poolcfg -dc 'create pool pool1 (string pool.scheduler="FSS")'

 

# poolcfg -dc info | more

 

The pool appears in the output, and is assigned to the Fair Share Scheduler. Note in the last line of the pool's configuration that the default processor set is assigned to the pool.

 

4. Assign the configured processor set to the pool. In this example the previously configured processor set pset1 is assigned to the pool pool1.

 

# poolcfg -dc 'associate pool pool1 (pset pset1)'

 

# poolcfg -dc info | more

 

The last line of the pool's configuration now shows that the processor set pset1 is assigned to pool1.

 

system maryann
        string  system.comment 
        int     system.version 1
        boolean system.bind-default true
        int     system.poold.pid 759
 
        pool pool_default
                int     pool.sys_id 0
                boolean pool.active true
                boolean pool.default true
                int     pool.importance 1
                string  pool.comment 
                pset    pset_default
 
        pool pool1
                int     pool.sys_id 0
                boolean pool.active true
                boolean pool.default true
                int     pool.importance 1
                string  pool.comment pool.scheduler="FSS"
                pset    pset1
 
        pset pset_default
                int     pset.sys_id -1
                boolean pset.default true
                uint    pset.min 1
                uint    pset.max 65536
                string  pset.units population
                uint    pset.load 182
                uint    pset.size 1
                string  pset.comment 
 
        pset pset1
                int     pset.sys_id -2
                boolean pset.default false
                uint    pset.min 1
                uint    pset.max 2
                string  pset.units population
                uint    pset.load 0
                uint    pset.size 0
                string  pset.comment 
 
                cpu
                        int     cpu.sys_id 0
                        string  cpu.comment 
                        string  cpu.status on-line
                 cpu
                        int     cpu.sys_id 1
                        string  cpu.comment 
                        string  cpu.status on-line

 

Write the configuration to the file /etc/pooladm.conf so it will survive reboot.

 

# pooladm -s

 

5. Configure a zone with CPU management and Fair Share Scheduling

 

The following zone configuration is for a minimal zone without networking, access to devices or access to file systems. Any of these resources can be added to a zone along with resource management. In this example the previously configured resource pool “pool1” is added to the zone and processes in the zone are assigned to the class FSS by configuring the resource “zone.cpu-shares.”

 

# zonecfg -z zonea

zonea: No such zone configured

Use 'create' to begin configuring a new zone.

zonecfg:zonea> create

zonecfg:zonea> set zonepath=/zonea

zonecfg:zonea> set autoboot=true

zonecfg:zonea> set pool=pool1

zonecfg:zonea> add rctl

zonecfg:zonea:rctl> set name=zone.cpu-shares

zonecfg:zonea:rctl> add value (priv=privileged,limit=20,action=none)

zonecfg:zonea:rctl> end

zonecfg:zonea> info

zonecfg:zonea> verify

zonecfg:zonea> commit

zonecfg:zonea> exit

 

The zone has now been configured with the use of the pool pool1, whose processes will all run under the Fair Share Scheduler. This has no effect on the zone unless the pool is also assigned to another zone. In the above configuration, the zone is assigned twenty shares of the CPU cycles of the CPUs in the pool. If no configuration of resource control had been made, the zone would have received the default: one share.

 

Fair Share Scheduling may be added to a zone configuration after it is installed or when the zone is initially configured.

 

Install the zone:

# zoneadm -z zonea install

 

...(much later)...

 

# ps -efc

 

The output from ps -ef will show processes in the global zone, which will be under the control of the TS and IA scheduling classes.

 

# zoneadm -z zonea boot

 

...(a short time later)...

 

# zoneadm list -iv

 

You should see that the zone is running and has been assigned a zone ID number.

 

# zlogin -C zonea

 

(wait a minute, then hit return)

 

Set up the zone console. You can usually get this to work on a Gnome desktop by choosing the terminal type "xterm" and then using ESC-2 to move forward through the screens.

 

Allow the zone to reboot.

 

# ps -efc

 

Processes in the zone are now visible and all but “zsched” are under the control of the FSS scheduling class.

 

Additional zones may be configured and assigned the same CPU pool with different shares of the Fair Share Scheduler.

 

Hosted by www.Geocities.ws

1