Re: [zones-discuss] limiting a percentage of CPU resource on a zone

2007-04-26 Thread Dick Davies

On 26/04/07, DJR [EMAIL PROTECTED] wrote:

Hi,

What would be the best way/easiest way to limit an amount of a  8core CPU  to a 
specific zone.

Can I do it in such a way to limit 2 of 8 cores, or does it have to be in a 
percentage bases.

Im assuming it would be done with zonecfg, any help is appreciated.


Project Duckhorn (Solaris Express = b55) makes this pretty easy -
zonecfg has been extended to support new keywords, so you just have
to :

zonecfg -z somezone
add dedicated cpu
 set ncpus=2-8
end

and reboot the zone.

From the zonecfg manpage:


dedicated-cpu: ncpus, importance

The number of CPUs that  should  be  assigned  for  this
zone's  exclusive  use.  The zone will create a pool and
processor  set  when  it  boots.  See  pooladm(1M)   and
poolcfg(1M)  for more information on resource pools. The
ncpu property can specify a single value or a range (for
example,  1-4)  of  processors.  The must be enough free
processors to allocate to this zone when it boots or the
zone will not boot. The processors assigned to this zone
will not be available for the use of the global zone  or
other zones. This resource is incompatible with the pool
property. Only a single instance of this resource can be
added to the zone.





--
Rasputin :: Jack of All Trades - Master of Nuns
http://number9.hellooperator.net/
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] limiting a percentage of CPU resource on a zone

2007-04-26 Thread Jerry Jelinek

DJR wrote:

Hi,

What would be the best way/easiest way to limit an amount of a  8core CPU  to a 
specific zone.

Can I do it in such a way to limit 2 of 8 cores, or does it have to be in a 
percentage bases.

Im assuming it would be done with zonecfg, any help is appreciated.


Some folks have already responded that you can use pools to do this.
There was also an response about duckhorn which is a project that
includes features that make setting up a pool for a zone very easy.

There are actually several different ways to accomplish this,
depending on what you want to do.  Pools is one solution.  For
your configuration you would carve out 2 cpus for the zone.  One
drawback with pools is that those 2 cpus are no longer available
for other zones, bound to different pools, to use when the one
zone is idle.

Another solution is the fair share scheduler (FSS).  You can assign
25 shares to the zone and 75 shares to the global zone (as an
example).  FSS only kicks in when there is more work than cpu resources
so you can overprovision the system but still guarantee a minimum
equivalent to two cpus for the one zone  and it guarantees the global
zone will get at least the equivalent of 6 cpus and maybe more if the
other zone is not so busy.

Finally, you could use cpu-caps to set a limit.  You could set
the cpu-cap to 200 (equivalent to 2 cpus).  This doesn't guarantee
a minimum.  It sets a maximum but still allows all of the
work to run on all 8 cpus and you can still overprovision the
system if the one zone isn't always using two full cpus.

You can also combine these various solutions in useful ways.

The duckhorn project does try to make the configuration of these
features simpler and better integrated in zonecfg.  You might
want to take a look at it or at the zones docs for all of this.

I have a blog about it here: http://blogs.sun.com/jerrysblog/
which might be a good starting point.

Jerry
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] limiting a percentage of CPU resource on a zone

2007-04-26 Thread Jeff Victor
Although the next release of Solaris 10 (mid-year 2007) will have the 
wonderful new features that Jerry mentions, until then, here is an example of 
commands to use. They create two pools and associate one zone with each pool.


lloy0076 wrote:


Howdy,

* http://docs.sun.com/app/docs/doc/817-1592/6mhahuoli?a=view#gdoqj

On a system that has zones enabled, a non-global zone can be associated 
with one resource pool, although the pool need not be exclusively 
assigned to a particular zone. Moreover, you cannot bind individual 
processes in non-global zones to a different pool by using the poolbind 
command from the global zone. To associate a non-global zone with a 
pool, see Configuring, Verifying, and Committing a Zone.


---

Ths implies that if you know how to limit/configure a resource pool, 
you've probably answered the question you're asking.


If I understand it, you'd:

* configure a resource pool

 * set what limits (or lack of limits) you want it

global# svcadm enable pools pools/dynamic
global# pooladm -s

Create a file poolfile which specifies the two processor sets and pools,
and tells Solaris to try to keep both pools 80%, but give priority to 
apppset.  More specifically, if CPU utilization of apppset is 80%, try to 
bring it under 80% by shifting a CPU from webpset to apppset, within the 
limits of minimum and maximum CPUs specified.  It also tells Solaris that if 
the webpset CPU utilization is 80%, *and* apppset CPU utilization is 80%, it 
should shift a CPU from apppset to webpset, again within the CPU limits specified.


=
create pool webpool
create pool apppool
create pset webpset (uint pset.min=1; uint pset.max=2)
create pset appset (uint pset.min=2; uint pset.max=3)
associate pool webpool (pset webset)
associate pool apppool (pset appset)

modify pset webpset (string pset.pool.objectives=utilization80)
modify pool webpool (int pset.pool.importance=1)
modify pset apppset (string pset.pool.objectives=utilization80)
modify pool apppool (int pset.pool.importance=2)

modify system default (string system.pool.objectives=wt=load)
=

Use that file:
global# poolcfg -f poolfile

Verify the config:
global# poolcfg -c info

Save the now-active config for next boot:
global# pooladm -c




* associate it with a zone [or project or task etc]


global# zonecfg -z webzone
set zone.pool=webpool
exit

global# zonecfg -z appzone
set zone.pool=apppool
exit


Now...  wasn't Jerry's 'duckhorn' method easier?  ;-)



--
Jeff VICTOR  Sun Microsystemsjeff.victor @ sun.com
OS AmbassadorSr. Technical Specialist
Solaris 10 Zones FAQ:http://www.opensolaris.org/os/community/zones/faq
--
___
zones-discuss mailing list
zones-discuss@opensolaris.org


Re: [zones-discuss] limiting a percentage of CPU resource on a zone

2007-04-25 Thread lloy0076


Howdy,

* http://docs.sun.com/app/docs/doc/817-1592/6mhahuoli?a=view#gdoqj

On a system that has zones enabled, a non-global zone can be associated 
with one resource pool, although the pool need not be exclusively 
assigned to a particular zone. Moreover, you cannot bind individual 
processes in non-global zones to a different pool by using the poolbind 
command from the global zone. To associate a non-global zone with a 
pool, see Configuring, Verifying, and Committing a Zone.


---

Ths implies that if you know how to limit/configure a resource pool, 
you've probably answered the question you're asking.


If I understand it, you'd:

* configure a resource pool
* set what limits (or lack of limits) you want it
* associate it with a zone [or project or task etc]

DSL
___
zones-discuss mailing list
zones-discuss@opensolaris.org