Information Technology Reference
In-Depth Information
Because Solaris identifies each hardware thread as a CPU, you can create very
flexible resource pools. For example, on a Sun T5440 you can create seven 32-
CPU pools and still have 32 CPUs left for the global zone! Most multithreaded
CPUs have some shared cache, so if you want to optimize performance you should
configure CPU quantities in multiples of 4 or 8, depending on the architecture of
that CPU.
Finally, the kernel does not enforce a limit on the total number of CPUs con-
figured in different pools or Containers until they are actually running. Thus you
can configure and install ten 128-CPU Containers on a T5440 as long as you run
only one at a time. Alternatively, you could configure and run 10 Containers, each
with 20-128 CPUs. In other words, you can over-subscribe CPUs.
Oracle Solaris CPU Caps The final CPU resource control available for Containers
is the CPU cap . You can use such a cap to tell Solaris that the processes of a
specific Container should not be allowed to use more than a certain amount of
CPU time, over a small sampling period. This cap allows granularity to be specified
in hundredths of a CPU—for example, 5.12 CPUs.
For example, to assign a CPU cap equivalent to 4 1 3 CPUs, use the following
command:
GZ# zonecfg -z web
zonecfg:web> add capped-cpu
zonecfg:web:capped-cpu> set ncpus=4.33
zonecfg:web:capped-cpu> end
zonecfg:web> exit
GZ# zoneadm -z web reboot
After the zone is rebooted, this value can be queried with the following command:
GZ# prctl -n zone.cpu-cap -i zone web
zone: 6: web
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
zone.cpu-cap system 4.33 inf deny -
Similarly, this resource constraint can be dynamically changed for a running
Container:
GZ# prctl -n zone.cpu-cap -t privileged -v 300 -i zone web
Note that the prctl command requires an integer value representing hun-
dredths of a CPU. In the example command, 300 means “300 hundredths of one
CPU,” which is equivalent to 3.00 CPUs.
 
Search WWH ::




Custom Search