Changing cgroup possible?


Recommended Posts

I've been having a slight nuisance with the Pterodactyl panel/daemon, every gameserver container it spins up doesn't show cpu/mem usage. The team behind Pterodactyl says it has something to do with using cgroup v1 and changing it to v2 should correct this issue.


Is this possible and if so, are there any negative effects?

 

Issue discussed on Pterodactyl github:

https://github.com/pterodactyl/panel/issues/3999

Link to comment
  • 1 month later...
  • 3 weeks later...
  • 5 weeks later...

No, that is not possible on Unraid or better speaking Slackware (at least to my knowledge it's not possible on Slackware and Unraid is based on Slackware).

Usually you enable cgoup2 with "systemd.unified_cgroup_hierarchy=1" in the boot parameters but that won't work on Unraid/Slackware because it uses init

cgroup2 is at least supported on Unraid/Slackware but you simply can't enable it (to check simply execute: "grep cgroup /proc/filesystems")

However you can enable cgroup2 after you've booted Unraid but that will not work reliably because you can only mount the controllers in one hierarchy so there is not really much benefit from that, the stats also wont work and even worse the stats from the Docker page won't work either after doing this:
Stop the Docker service
Execute "mount -t cgroup2 none /sys/fs/cgroup"
Start the Docker service again
Run "docker info | grep -i cgroup" and you should see that it now uses v2

Also note that Docker needs to be at least on version 20.10+ for this but I would strongly recommend you to not try this on your main server!

 

However if you really want to try I got a build where cgroup v2 is working but I haven't tested it extensively and can't tell if something isn't working...

Fell free to contact me if someone got interested.

Link to comment

I had made the change to try it out, but discovered that neither Emby, nor Plex would start afterwards. Emby provided an error stating "unable to control /var/run/s6/services". I didn't see anything of note in the Plex logs. If anyone has any ideas as to why that may be happening, I'm all ears. For posterity, I'll just put this here for anyone else that may need to revert the change:


Disable cgroup2

  1. Stop the Docker service
  2. Execute `umount -t cgroup2 none`
  3. Start the Docker service
Link to comment
11 minutes ago, Ssayer said:

Per Parkervcp's comments on Github, the issue is with Unraid's Docker version, not CGroup status.  I just updated to 6.11.0-rc2 and can now see resource usage in Pterodactyl Panel, so I'm inclined to agree with that assessment.  If you need resource usage to work immediately, upgrading to the RC is an option.  Otherwise, you should be good to go when 6.11 is released.

I would not believe everything, there is also more too it sometimes... ;)

Does this user even run Unraid? :D

 

Docker officially supports cgroup2 since Docker v20.10 and this version was included in 6.10.0 and the release date was: 2022-05-07

 

26 minutes ago, jeaboswell said:

I had made the change to try it out, but discovered that neither Emby, nor Plex would start afterwards. Emby provided an error stating "unable to control /var/run/s6/services". I didn't see anything of note in the Plex logs. If anyone has any ideas as to why that may be happening, I'm all ears. For posterity, I'll just put this here for anyone else that may need to revert the change:

Yes, exactly, because the control groups are assigned to cgroup1 and you simply can't change the control groups when they are still in use, but as said you can run cgroup2 on Unraid as you can see here:

grafik.thumb.png.ab04c7b82cdb763d78ed5c0255076fe0.png

 

of course everything else is running too like Emby and so on... ;)

As said above I haven't tested everything but as far as I can tell everything seems to be working fine.

 

27 minutes ago, jeaboswell said:

Disable cgroup2

  1. Stop the Docker service
  2. Execute `umount -t cgroup2 none`
  3. Start the Docker service

This is also not the proper way to do it, I would always recommend rebooting when messing with the cgroups

Link to comment
8 minutes ago, ich777 said:

I would not believe everything, there is also more too it sometimes... ;)

Does this user even run Unraid? :D

I'm inclined to give this particular user some weight, since he is one of Pterodactyl Panel's contributors.  Further, since I've done nothing other than install the RC (which included a Docker version update) and container statistics now work, I think it's got decent merit.

 

8 minutes ago, ich777 said:

Docker officially supports cgroup2 since Docker v20.10 and this version was included in 6.10.0 and the release date was: 2022-05-07

From reading the rest of the issue discussion posted in OP, it seems to be an issue with the particular version of Docker bundled in 6.10.3, and doesn't actually have anything to do with the availability of cgroup2.

 

Not sure why this is a point of contention.  I simply noted his recommendation and reported my findings.  

Link to comment
29 minutes ago, Ssayer said:

Further, since I've done nothing other than install the RC (which included a Docker version update) and container statistics now work, I think it's got decent merit.

This is actually related to containerd…

 

 

 

Anyways glad it is fixed for you with 6.11 :)

Link to comment
  • 8 months later...

My `docker info` shows I'm running cgroup 1. Also my `docker stats` has the 0% everything cpu. I've been trying to figure this out for a while but gave up as I would like to see cpu usage of containers.

 

I believe this could be related, and it's a starting point to debug potential issues other's are having with this container as well here: 

 

I see in Unraids release notes about enabling cgroup 2 with a "syslinux append line." Can someone describe this procedure in more detail. I'm not as familiar with what exactly that means. 

 

Quote

## Version 6.11.0 2022-09-23

### Improvements

...

- Preliminary support for cgroup2. Pass 'unraidcgroup2' on syslinux append line to activate.

Found: https://unraid-dl.sfo2.cdn.digitaloceanspaces.com/stable/unRAIDServer-6.11.1-x86_64.txt

 

I'm on the latest Unraid version 6.11.5. Thank you.

Link to comment

It looks like I'm having issues related to this and not being able to set a "hybrid" cgroup setup. This seems to be issues mostly related to Docker, something Podman doesn't exhibit. So I'm pretty annoyed.

 

I set the following run flags on this container

 

--cgroup-parent=docker.slice --cgroupns private --security-opt seccomp=unconfined --tmpfs /tmp --tmpfs /run --tmpfs /run/lock --restart=always --log-opt max-size=1m --ulimit nofile=90000:90000

and no volume mount for /sys/fs/cgroup

 

but am getting the following error:

 

Failed to mount cgroup at /sys/fs/cgroup/systemd: Operation not permitted

 

It seems setting the systemd.unified_cgroup_hierarchy=0 is the solution but since this is not possible in unraid, it's unclear what to do. As well this kind of setup is getting extremely convoluted just to be able to run systemd in a container. So I'm starting to think again that's probably not worth the headache.

 

@ich777 Do you have any idea of what to do here? I see you're following this type of issue on github for LXC as well?

Link to comment
1 minute ago, gvkhna said:

@ich777 Do you have any idea of what to do here? I see you're following this type of issue on github for LXC as well?

No, not anymore, the issue was solved by adding cgroupv2 to Unraid.

 

1 minute ago, gvkhna said:
Failed to mount cgroup at /sys/fs/cgroup/systemd: Operation not permitted

Do you run the container with in provileged mode? But I don‘t think that this will help bor that this is a good idea.

 

Sorry but I even don‘t know what this container is…

Link to comment
6 minutes ago, gvkhna said:

I did that, that got me in the right direction. But this container would not start with that error. Container running in privileged yes. The container is the mullvadvpn container I liked in my last message: 

I even don‘t know what this container is used for.

You can try to install it in a LXC container and see if this is working.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.