Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgroup support for memory and cpu limiting #56

Merged
merged 28 commits into from
Sep 1, 2022

Conversation

marina-vrublevsky
Copy link
Contributor

@marina-vrublevsky marina-vrublevsky commented Jul 4, 2022

In this PR:

  1. Add PID to memory and cpu cgroup
  2. Limit memory of cgroup
  3. Limit amount of cores usage of cgroup

To Do:

  1. Add memory and cpu usage methods
  2. Support for cgroup v2

@michelhe michelhe self-assigned this Aug 25, 2022
@michelhe
Copy link
Contributor

Generally I don't like the terminology of cgroups_client, I suggest simply cgroups, would be a good module name IMO

Copy link
Contributor

@michelhe michelhe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, not done

@Jongy
Copy link
Contributor

Jongy commented Aug 26, 2022

I'd like to review it as well, but first let's sync IRL on the purpose and what we try to achieve here, description wasn't clear enough to me

@marina-vrublevsky
Copy link
Contributor Author

marina-vrublevsky commented Aug 28, 2022

Generally I don't like the terminology of cgroups_client, I suggest simply cgroups, would be a good module name IMO

@michelhe As i stated in the description (todo.2) there is currently another cgroups.py
we need to decide if we want to merge them

@michelhe
Copy link
Contributor

Generally I don't like the terminology of cgroups_client, I suggest simply cgroups, would be a good module name IMO

@michelhe As i stated in the description (todo.2) there is currently another cgroups.py we need to decide if we want to merge them

It only consists of a single of function, you can just put it in the __init__.py of this module

@marina-vrublevsky marina-vrublevsky marked this pull request as draft August 28, 2022 09:17
Copy link
Contributor

@Jongy Jongy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll complete the pass later. Meanwhile - we still have naming weirdnesses here, so let's define clear names, following https://man7.org/linux/man-pages/man7/cgroups.7.html:

  • A cgroup type i.e memory, cpu,cpuacct is called subsystem. Ensure all cgroup_type and controller are renamed to subsystem. (You may also choose controller, I don't mind, but be consistent)
  • A cgroup path (i.e /, /docker/....) is called cgroup
  • Any other?

Copy link
Contributor

@Jongy Jongy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few last. Please test it as we discussed in private

@marina-vrublevsky marina-vrublevsky merged commit 00edbd8 into master Sep 1, 2022
@marina-vrublevsky marina-vrublevsky deleted the feature/cgroups branch September 1, 2022 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants