Setting up cgroups on Ubuntu

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting up cgroups on Ubuntu

Michał Sawicz-2
Hey all,

Is there a recommended way of setting up cgroups on Ubuntu? I see we
don't have `cgrulesengd` set up as a service, so is just running
`cgconfigparser` on boot and using `cgexec` the recommended approach?

Or even dealing directly with the cgroups filesystem?

Thanks!
--
Michał (Saviq) Sawicz <[hidden email]>


--
ubuntu-devel mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Setting up cgroups on Ubuntu

Dimitri John Ledkov
Hi,

On Tue, 23 Oct 2018 at 09:57, Michał Sawicz <[hidden email]> wrote:
>
> Hey all,
>
> Is there a recommended way of setting up cgroups on Ubuntu? I see we
> don't have `cgrulesengd` set up as a service, so is just running
> `cgconfigparser` on boot and using `cgexec` the recommended approach?
>
> Or even dealing directly with the cgroups filesystem?
>

This is a very low-level question, which feels like one is jumping to
conclusions/solution without stating the problem/user-story/goal. Can
you elaborate and start from the beginning and what prompted you to
find cgrulesengd?

All system, user, and container processes on Ubuntu are segregated
into cgroups with a default equal balancing of resources. And one can
further adjust resource allocations using service, slice, scope
settings. Or use delegation for further management. There are examples
of using all of those things by various things in Ubuntu by default...
but it's hard to point you at something specific, without at all
knowing what is your actual use case.

Also, I'm not sure if you are trying to escape default allocation and
get a bigger slice, or on the contrary further sub-divide the
resources your process was given.

Regards,

Dimitri.

--
ubuntu-devel mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel
Reply | Threaded
Open this post in threaded view
|

Re: Setting up cgroups on Ubuntu

Michał Sawicz-2
W dniu 23.10.2018 o 09:57, Dimitri John Ledkov pisze:

>> Hey all,
>>
>> Is there a recommended way of setting up cgroups on Ubuntu? I see we
>> don't have `cgrulesengd` set up as a service, so is just running
>> `cgconfigparser` on boot and using `cgexec` the recommended approach?
>>
>> Or even dealing directly with the cgroups filesystem?
>>
> This is a very low-level question, which feels like one is jumping to
> conclusions/solution without stating the problem/user-story/goal. Can
> you elaborate and start from the beginning and what prompted you to
> find cgrulesengd?
>
> All system, user, and container processes on Ubuntu are segregated
> into cgroups with a default equal balancing of resources. And one can
> further adjust resource allocations using service, slice, scope
> settings. Or use delegation for further management. There are examples
> of using all of those things by various things in Ubuntu by default...
> but it's hard to point you at something specific, without at all
> knowing what is your actual use case.
>
> Also, I'm not sure if you are trying to escape default allocation and
> get a bigger slice, or on the contrary further sub-divide the
> resources your process was given.
Hey,

OK let me track back:

I'm asking this in the context of multipass - when memory in the
instance is exhausted, the virtual machine becomes unresponsive, there's
no way to investigate what's going on, and the OOM killer doesn't seem
to be able to kick in either. There's no swap configured, btw, but we
wouldn't like to add that.

So what we wanted to do is limit the memory usage of user-invoked
commands (those via `multipass exec`) to leave a minimum amount of
memory free so that you can always access the vm.

So the plan was to create a cgroup limited to a certain amount of memory
and put all the tasks created through `multipass exec` in there.

That led me to cgconfigparser / cgrulesengd, but I couldn't find much in
terms of a "guide" on how it's recommended to work it on Ubuntu.

HTH,
--
Michał Sawicz <[hidden email]>


--
ubuntu-devel mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel

signature.asc (849 bytes) Download Attachment