Global and non-global zone resource sharing - tricky

hi all,

Just a simple question but i cant get the answers in the book -

In my globalzone , assuming i have 4 cpus (psrinfo -pv = 0-3), if i set dedicated-cpu (ncpus=2) for my local zone

Is my globalzone left with 2 cpus or still 4 cpus ? Does localzone "resource reservation.e.g. cpu in our case above" have any impact to the globalzone ?

For i am thinking-if it does and if i setup 2 local zones with dedicated cpu = 2, doesn't that leave my globalzone with no cpu to run ?

Regards,
Noob

The zone restrictions do not apply to the global zone - it can use all 4 CPUs.

1 Like

Hi MadeInGermany,

Thanks for your reply.

q1) Does that means that the global zone will always be able to utilized all the cpus resources irregardless if they are assigned to local zones or not ? - am I right

q2) I have an application running in globalzone, in that server, there are no other non-globalzone.

Is there anyway I can limit the cpu utilization in globalzone ?

  • can I set dedicated-cpu to a global-zone ?
  • I believe we can set a capped-cpu to a global zone

Regards,
Noob

Well, rule of thumb is not to run applications in global zone.
Exception could be backup software or monitoring/log shipment software..

Is there any practical reason not to have that application running in non-global zone ?

Personally, i use FSS scheduler with global/non-global zones and control the CPU resources using shares. Global zone has 1 share by default.

Shares are bit different then CPU caps you are using.. for instance you have 10 shares of CPU (when used 100% all 10 shares are used) running 1 global zone and 2 zones.

You set 6 and 3 cpu shares for two non-global zones (1 is for global zone), which means that zone with 6 shares will get 60% of CPU in case of CPU resource contention.
Otherwise it can use all the CPU.

So FSS guarantees CPU time in mentioned relation.
10 CPU share = 100 % CPU, global zone : zone1 : zone2 = 1:6:3

10 is a number you choose, you can choose 100 as well as any other number which will represent maximum CPU time which you will divide among zones.

I found this to be most effective in terms of harnessing CPU power when needed by single zone so far and giving guarantees if things go bananas.

Of course, you can change that as administrator from global zone, even on runtime, using prctl effectively giving additional CPU shares to a zone or a single process.

Hope that helps
Regards
Peasant.

1 Like

q1) yes
q2)
you cannot put zone limits to the global zone.

man prctl

shows the available resources; you can try to set project.cpu-shares to a certain project, then assign certain processes to that project. I have no experience with that. Instead I have used the classic commands

nice startprocess
renice <pid>
1 Like

Hi Peasant, Made in Germany,

Thank for the feedback.

-> Peasant
I am not sure if i am able to use FSS due to oracle database licensing which required me to cap the cpu utilization the a maximum of the amount of core which is/are licensed.

But however, i am curious about what you mentioned about FSS, do you mean if there are no contention, a zone which is assign e.g. 3 shared might be able to get more then >3 ?

-> MadeInGermany,

Somehow i felt that allocating dedicated cpu to non-globalzone did take away the cpu resource from the global, base on some simple finding which i observed

a) i cannot create a zone that utilized all the cpu resources available. (e.g. there are a total of 4 cpu, if i set dedicated = 4ncpus) the zone will fail to boot.
(if globalzone has access to all the cpus irregardless if any dedicated cpus are assigned to non-globalzone, then why can't we assign all the cpus to a non-globalzone then)

b) when assigning dedicated cpu to a non global-zone and issuing pooladm afterwards, the default pset cpu amount got lesser.
which i believe anyzone (including globalzone) which are not explicitly assign to anypool will be assigned to the default pool -> default pset .

please let me know your views. (i been googling, reading tons of docs but to no avail).

Regards,
Noob

It is simple, if there is not contention, any zone can take all the CPU.

As for Oracle database licensing, this is a descent document :

FSS is not confromant unless you are paying all the physical cores in your machine.