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

enable cgroup accounting #29095

Closed
davidak opened this issue Sep 7, 2017 · 7 comments · Fixed by #66922 or #66984
Closed

enable cgroup accounting #29095

davidak opened this issue Sep 7, 2017 · 7 comments · Fixed by #66922 or #66984

Comments

@davidak
Copy link
Member

davidak commented Sep 7, 2017

Issue description

I want to see systemd services in netdata monitoring. For that "cgroup accounting" is needed.

https://github.com/firehol/netdata/wiki/monitoring-systemd-services

The question is if enabling it on all systems would have any negative effect. In that case i would activate it only when netdata service is enabled.

Arch Linux, Ubuntu and Fedora seem to have it enabled by default. debian not.

Steps to reproduce

systemd-cgtop shows no resources for services.

Technical details

  • System: NixOS 17.03.1700.51a83266d1 (Gorilla)
  • Nix version: nix-env (Nix) 1.11.13
  • Nixpkgs version: "17.03.1700.51a83266d1"
  • Sandboxing enabled: build-use-sandbox = true
@globin globin added this to the 18.03 milestone Sep 8, 2017
@davidak
Copy link
Member Author

davidak commented Sep 27, 2017

I will implement it as option, that is enabled by default and for netdata service.

systemd.enableCgroupAccounting

@andrew-d
Copy link
Contributor

I believe you can set this with:

systemd.extraConfig = ''
  DefaultCPUAccounting=yes
  DefaultIOAccounting=yes
  DefaultBlockIOAccounting=yes
  DefaultMemoryAccounting=yes
  DefaultTasksAccounting=yes
'';

And maybe also:

boot.kernelParams = [ "cgroup_enable=memory" "swapaccount=1" ];

(ideas from here)

@davidak
Copy link
Member Author

davidak commented Feb 27, 2018

@andrew-d sure, that is how i do it right now. But i want to propose it to be enabled by default, so you have it when you need it for debugging. But also a single option to disable it when you have reasons to.

@samueldr
Copy link
Member

samueldr commented Aug 27, 2018

Is this still open for the discussion about defaulting to true or is this still open simply because it wasn't closed? Unless something else than the PR is required? (@davidak)

@davidak
Copy link
Member Author

davidak commented Aug 27, 2018

I created this issue to have this enabled for netdata. So an additional PR needs to be created to enable the new option when netdata is enabled.

In addition it could be discussed to enable the option by default when a desktopManager is enabled (for desktop users). It should not be enabled by default on servers because it could have a little impact on performance.

@matthewbauer matthewbauer modified the milestones: 18.09, 19.03 Nov 5, 2018
@matthewbauer matthewbauer modified the milestones: 19.03, 19.09 May 27, 2019
@flokli
Copy link
Contributor

flokli commented Aug 19, 2019

@davidak Nowadays, this might already be enabled per default half-way:

from my `systemd-system.conf (latest master right now)

       DefaultCPUAccounting=, DefaultBlockIOAccounting=, DefaultMemoryAccounting=, DefaultTasksAccounting=,
       DefaultIOAccounting=, DefaultIPAccounting=
           Configure the default resource accounting settings, as configured per-unit by CPUAccounting=,
           BlockIOAccounting=, MemoryAccounting=, TasksAccounting=, IOAccounting= and IPAccounting=. See systemd.resource-
           control(5) for details on the per-unit settings.  DefaultTasksAccounting= defaults to yes,
           DefaultMemoryAccounting= to yes.  DefaultCPUAccounting= defaults to yes if enabling CPU accounting doesn't
           require the CPU controller to be enabled (Linux 4.15+ using the unified hierarchy for resource control),
           otherwise it defaults to no. The other three settings default to no.

Are there any recent figures about performance implications when enabling the rest? If Fedora enables it, we could probably do so too.

@davidak
Copy link
Member Author

davidak commented Aug 19, 2019

this might already be enabled per default half-way

thanks for noticing! can you create an issue or PR to change systemd.enableCgroupAccounting?

Are there any recent figures about performance implications when enabling the rest?

i don't know any. i have no issues on my servers where i set it manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants