zonecfg:myzone> add capped-cpu
zonecfg:myzone>capped-cpu> set ncpus=120
zonecfg:myzone>capped-cpu>capped-cpu> end
When the zone runs, I can see all 128 processors with /usr/sbin/
psrinfo, which rather suggests to me that the limit of 120 is not
being enforced.
I was under the impression the caps were by threads on multi-core
machines, rather than physical processors or cores.
I've printed the configuration file below. The CPU bit appears to be
set name=zone.cpu-cap
add value (priv=privileged,limit=12000,action=deny)
end
Any ideas what's wrong?
Dave
root@t2 # cat t2nb.cfg
create -b
set zonepath=/zones/t2nb
set autoboot=true
set ip-type=shared
add inherit-pkg-dir
set dir=/lib
end
add inherit-pkg-dir
set dir=/platform
end
add inherit-pkg-dir
set dir=/sbin
end
add inherit-pkg-dir
set dir=/usr
end
add fs
set dir=/usr/local
set special=/rootpool2/usr_local
set type=lofs
add options ro
add options nodevices
end
add net
set address=128.208.128.196/25
set physical=nxge0
end
add rctl
set name=zone.cpu-cap
add value (priv=privileged,limit=12000,action=deny)
end
add rctl
set name=zone.max-swap
add value (priv=privileged,limit=16106127360,action=deny)
end
add capped-memory
set physical=20G
end
The machine is running Solaris 10 update 6 (05/2009), so not quite the
latest, but not that old either.
You might want dedicated-cpu rather than capped-cpu
http://dlc.sun.com/osol/docs/content/SYSADRM/z.config.ov-3.html
I set the ncpus on a 2 thread AMD system to .5
capped-cpu:
[ncpus: 0.50]
rctl:
name: zone.cpu-cap
value: (priv=privileged,limit=50,action=deny)
zonecfg:zone1> exit
ultra20:/> zoneadm -z zone1 boot
ultra20:/> zlogin zone1
[Connected to zone 'zone1' pts/3]
Last login: Wed Dec 2 16:23:33 on pts/4
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
# psrinfo
0 on-line since 12/15/2009 12:01:52
1 on-line since 12/15/2009 12:01:56
and it too shows both threads when doing a psrinfo within the zone, so
I am inclined to think the cap is enforced but the psrinfo output is
not changed. I do agree with Dr Kirkby that using a dedicated pool
might be a better solution.
Thank you for that link. I was not aware of the difference, so at
least I can read about it.
I'd rather not dedicate 120 processors to the zone, but let the zone
uses as many as it needs, up to 120, or 94% of the available CPU
resources.
I know there is the possibility of processor sets too. I suppose what
I really want is a way of making sure the gobal zone has source
resources left. There may be one or two zone on the machine. Perhaps I
need to dedicate 10 cpus to the global zone, then let the other zones
fight among themselves!
Dave
You should implement FSS ( Fair share scheduling ) where each zone has
a ratio set. This ratio determines which zone gets CPU when all are
competing based on the ratio set.
When only one zone needs CPU time then all the CPU is available.
Really useful feature which we use quit alot.
Here is a link that gives more detail.
http://www.princeton.edu/~unix/Solaris/troubleshoot/schedule.html
> I suppose what
> I really want is a way of making sure the gobal zone has source
> resources left.
Forget zones for a minute. You might be after the reserved_procs kernel parameter.
http://docs.sun.com/app/docs/doc/817-0404/6mg74vsbf?a=view#indexterm-15