On 2 December 2016 at 16:43, Nahum Shalman <[email protected]> wrote:
> I like to think about CPU as a resource either under contention (more
> processes need CPU time than CPU cores to go around) or not:
>
> CPU caps limit how much you can use when there's no contention. In the
> Joyent Could it ensures people don't get more CPU time than they pay for.
> (example 1 below)
>
> CPU shares ensure fairness when there is contention. If CPU shares are
> doled out in proportion to memory doled out (Like in the Joyent Cloud),
> when everyone is fighting for CPU, the more memory you're paying for, the
> more CPU cycles you'll get. (example 2 below)
>
> If all the zones on a box belong to the same customer (as might be the
> case on your machine), you could set the cpu caps much higher, and depend
> on the shares for fairness.
>
> Examples for clarification:
>
> 1. I fire up a g4-highcpu-2G zone in the Joyent cloud. It gets a CPU cap
> of 100. It happens to land on a freshly deployed compute node with no other
> zones on it.
> I then run 2 CPU intensive processes. There is no contention so the
> machine is totally capable of scheduling each of them on a separate CPU and
> running them full throttle.
> However, because I'm only paying for 1 1vCPU I hit that cap of 100 and my
> two processes have to take turns running. If my workload is really that CPU
> intensive I should scale the zone up to g4-highcpu-4G which gets 2vCPUs and
> a cap of 200.
>
> 2. At home I have a machine with 8 cores running SmartOS. I don't put caps
> on my zones because I am the only customer on the box so to speak. I
> provision 3 zones on the machine: the "important" zone that gets 600
> shares, and two "unimportant" ones that each get 200 shares. Each of them
> is running 8 CPU intensive processes (apparently I'm a glutton for
> punishment). I have given out 10000 shares. Because my numbers all divide
> evenly I can use simple fractions. The important zone get 6/10 or 3/5 of
> the CPU, and the other two each get 2/10 or 1/5. My math adds up: 3/5 + 1/5
> + 1/5 = 5/5 =1. The important zone gets approximately 4.8 cores worth of
> CPU time, and the unimportant ones each get approximately 1.6 cores worth.
> This is as good as things can be when I foolishly run too many CPU
> intensive workloads on my machine at home. Maybe it's time for a beefier
> box. :-P
>
> Was this helpful?
> -Nahum
>
>
Hi Nahum
Thats very useful. Inside the joyent public cloud how many cores do you see
inside an LX zone ? When I spin up an LZ zone I see all the cores on the
machine, which makes sense. So some customers see 40 Cores ("Intel(R)
Xeon(R) CPU E5-2670 v2 @ 2.50GHz") and some customers see 128 cores
("Intel(R) Xeon(R) CPU E7-4850 v4 @ 2.10GHz") regardless of the cpu_cap
setting.
The problem is as Ian said above that when cpu_cap is less than the core
count its tricky for our customers.
Thanks
Len
-------------------------------------------
smartos-discuss
Archives: https://www.listbox.com/member/archive/184463/=now
RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00
Modify Your Subscription:
https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb
Powered by Listbox: http://www.listbox.com