Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Capping CPU usage in zones.

2,031 views
Skip to first unread message

Dr. David Kirkby

unread,
Dec 23, 2009, 3:26:44 PM12/23/09
to
I've got a T5240 with 128 threads, then created a zone. I attempted to
cap the number of CPUs in the zone to 120 when running zonecfg. I
typed something like the following, which I took from the man page.

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


Dr. David Kirkby

unread,
Dec 23, 2009, 5:17:59 PM12/23/09
to
On Dec 23, 8:26 pm, "Dr. David Kirkby" <david.kir...@onetel.net>
wrote:

> I've got a T5240 with 128 threads, then created a zone.

The machine is running Solaris 10 update 6 (05/2009), so not quite the
latest, but not that old either.

John L

unread,
Dec 24, 2009, 3:25:08 AM12/24/09
to

"Dr. David Kirkby" <david....@onetel.net> wrote in message
news:268c3091-36e3-4a4c...@u7g2000yqm.googlegroups.com...

> I've got a T5240 with 128 threads, then created a zone. I attempted to
> cap the number of CPUs in the zone to 120 when running zonecfg. I
> typed something like the following, which I took from the man page.
>
> 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.

You might want dedicated-cpu rather than capped-cpu
http://dlc.sun.com/osol/docs/content/SYSADRM/z.config.ov-3.html

tim....@gmail.com

unread,
Dec 24, 2009, 9:49:39 AM12/24/09
to
On Dec 23, 1:26 pm, "Dr. David Kirkby" <david.kir...@onetel.net>
wrote:

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.

Dr. David Kirkby

unread,
Dec 24, 2009, 12:27:34 PM12/24/09
to
On Dec 24, 8:25 am, "John L" <j...@lammtarra.notthisbit.fslife.co.uk>
wrote:
> "Dr. David Kirkby" <david.kir...@onetel.net> wrote in messagenews:268c3091-36e3-4a4c...@u7g2000yqm.googlegroups.com...

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

Zfs..

unread,
Dec 24, 2009, 5:04:57 PM12/24/09
to
On Dec 24, 5:27 pm, "Dr. David Kirkby" <david.kir...@onetel.net>
wrote:

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


John L

unread,
Dec 25, 2009, 1:11:34 PM12/25/09
to

"Dr. David Kirkby" <david....@onetel.net> wrote in message
news:0cd9943e-dc1c-4fc7...@k19g2000yqc.googlegroups.com...

> 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

0 new messages