On 12/ 3/16 03:43 AM, Nahum Shalman 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.


Hello Nahum,

The problem with the current scheme is when you hit a capped zone with something like a parallel compile. The build tool will see all of the cores and happily spin up a compile or two on each. So on a decent machine like the one Len describes, there will be 64 CPU intensive jobs running on a machine with a cap one CPU... The result is the load average goes through the roof and the the box falls over. If you do this in a KVM, the KVM will curl up and die.

The only way I know to properly confine a guest is to use a KVM with matching CPU cap and count.

Cheers,

--
Ian.



-------------------------------------------
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

Reply via email to