Re: Quieting a Noisy Neighbor #cf
toggle quoted message Show quoted text
Hi Stanislav -- cpu usage is not currently unlimited, quotas are already enforced in proportion to a container's memory limit. If multiple containers on a cell each try to use all resources, they will each receive them in proportion to their memory limit. So, for example, if there are two 64MB apps attempting to use maximal resources, each will actually get 50%. If there's a 128MB app and a 64MB app, the 128MB app will get twice as much cpu as the 64MB app so 66% and 33% respectively. If a user wants to be able to use more cpu they can use a larger instance type (i.e. in Cloud Foundry memory limit is actually memory limit and cpu share). This is enforced using the cpu cgroup's `cpu.shares` mechanism. Operators should ensure that cells have enough cpu to support the number of apps (i.e. advertised memory limit) on their cells.
There's also the cpu maximums feature you linked to, this is an additional setting folks can opt in to - or not - to _also_ set an absolute maximum, also in proportion to memory limit, in addition to the relative shares which are enabled on every container as above. The advantage of the maximum is that it enforces an absolute limit, which cannot be exceeded even if spare resource is available, which can avoid confusion where apps sometimes get more cpu than they're entitled to because they land on a quiet cell. If I've read your script correctly I believe if you set the `cpu_quota_per_share_in_us` property that you linked to to a number based on the available memory in the host and the cpu_max_factor you desire it will have exactly the effect of your script.
Let me know if this answers your question or if there's a suggestion for another feature that I've missed here.
On Fri, 5 Jan 2018 at 17:03 Natalie Bennett <nbennett@...> wrote: