[SOLVED] LXC container with Centos 7 - systemd using 100% of CPU

albans

Active Member
May 7, 2015
49
1
26
Hi,

I've setup an LXC container (no protection, not unprivileged) with Centos 7 on proxmox 4.4-1/eb2d6f1e.
Randonmly, from time to time, systemd is using 100% of the CPU.
This creates major timeouts for all services running on this LXC container.

The only way to get around this is to restart the LXC container, and then everything's running fine again.

Do you have an idea on what can cause such issue? Any parameters to be used at the config level of the container?

Thanks for your help.
 
Recently found this post: https://daniele.vigano.me/blog/2015/03/fedora-21-lxc-systemd-journald-at-100/

Shall I then add the below line to /etc/pve/lxc/<CTID>.conf file? Or within another config file? And then reboot?

Code:
lxc.kmsg: 0

Thx for the feedback.
Do you think the below is also required?
Code:
lxc.autodev: 1
See https://gforge.inria.fr/tracker/?func=detail&atid=12150&aid=18907&group_id=3519

Also, I don't want to break anything as mentionned here: https://forum.proxmox.com/threads/lxc-suddenly-stopped-and-are-not-starting-any-more.25056/
 
Last edited:
I've tried both below lines in /etc/pve/lxc/<CTID>.conf
Code:
lxc.kmsg: 0
lxc.autodev: 1

It didn't help. Actually, I realise that systemd use 100% CPU and gets stuck when updating packages via yum. This only happens after the container has been running for a couple of days. It doesn't happen just after a reboot.

Any idea where I shall look to find the issue?

Thx for your help.
 
Finally found the fix - and it was not related to proxmox or lxc!
Thanks to https://github.com/systemd/systemd/issues/1961

Therefore, I just have to clean regularly systemd sessions within the LXC container with a script running on a daily basis:

Code:
#!/bin/sh

find /run/systemd/system -name "session-*.scope" -delete
rm -rf /run/systemd/system/session*scope*
systemctl | grep "abandoned" | grep -e "-[[:digit:]]" | sed "s/\.scope.*/.scope/" | xargs systemctl stop 2>&1 /dev/null
systemctl daemon-reload
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!