Sun Microsystems 10 用户手册

下载
页码 121
Version 3.1-en
  Solaris 10 Container Guide - 3.1   5. Cookbooks 
Effective: 30/11/2009
5.5.4. Fair share scheduler
[ug] The ratio of CPU usage between zones or projects can be set.
This is implemented by he so-called fair share scheduler. CPU shares are allocated as follows:
For zones, by using  add   rctl  and the attribute  zone.cpu-shares  in the  zonecfg 
command.
For projects, this is set in the project database (/etc/project, or NIS or LDAP) and the 
attribute project.cpu-shares (global and/or local zone).
The zones/projects must be allocated to the same resource pool.
In the resource pool, the fair share scheduler must be activated.
In  the  global  zone,   the   resource   pool  can  also  be  limited  to  a  subset   of   processors   in  the 
system.
The operating system provides for fairness, if the CPUs of the resource pool are used to capacity. 
The allocated shares of the projects and the zones with active processes are used to calculate the 
nominal value for CPU usage. The nominal value of CPU usage is calculated  with the formula: (zone 
shares) * (number of CPUs) / (sum of the shares of the active zones).
If   the  CPU  usage  approaches  100%  and  the   amount   of   consumed  CPU  time   is  larger  than  the 
nominal value, the fair share scheduler takes countermeasures by reducing priority.
Furthermore:
The settings for CPU shares can be dynamically set with the command prctl.
The affiliation of a zone with a resource pool can be changed at any time with the command 
poolbind.
If CPU usage in a resource pool is noticeably smaller than 100%, the fair share scheduler does not 
control CPU usage. In this situation, a zone in the resource pool can use more than it is actually 
entitled   to.   If   this   is   not   desired,   additional   limitation   with   processor   sets   or   cpu   capping   is 
recommended.
5.5.5. Static CPU resource management between zones
[ug] Static resource management between zones determines how resources should be distributed in 
a normal case following a booting routine:
To create a resource pool, the commands poolcfg and pooladm are used.
The affiliation of a zone to a resource pool for zonecfg can be set with the attribute pool.
The settings for fairness between the zones are adjusted with add   rctl in zonecfg. We 
recommend setting  zone.cpu-shares  (CPU share) and additionally  zone.max-lwps 
(maximum number of threads).
5.5.6. Dynamic CPU resource management between zones
[ug]  This  refers  to commands  that  allow the  user  to  reset  resource  controls  while  the  zones are 
running in order to react to a temporary load situation.
The commands prctl and poolbind are used. If necessary, new resource pools can temporarily 
be created with poolcfg and pooladm to separate loads.
5.5.7. Static CPU resource management in a zone
[ug] The ratio of CPU usage between  applications in a zone can be adjusted as well.
This is done with the definition of resource pools within the zone and use of the fair share scheduler 
with projects inside of the zone. Allocation of CPUs to resource pools is not possible within the zone.
The allocation of applications to projects is done by configuration in the files /etc/project 
and /etc/user_attr .
In /etc/project, it can be defined which resource pool a project should run in.
To create a resource pool in the zone, the commands  poolcfg  and   pooladm  are used. 
However, processors cannot be assigned.
In the resource pool, the fair share scheduler (FSS) must be activated.
5.5.8. Dynamic CPU resource management in a zone
[ug] This refers to commands used to reset the resource controls within the zone while running, in 
order to react to a temporary load situation.
The   commands  prctl  and  poolbind  can   be   used   to   change   share   values   of   projects   or 
associations   of   project   to   resource   pools.   If   necessary,   new   resource   pools   can   temporarily   be 
108