My server gets overloaded by lots of lxd --logfile processes

My server gets overloaded by lots of

lxd --logfile /var/snap/lxd/common/lxd/logs/lxd.log --group lxd

I noticed from having htop running a longer time.

Killing LXD directly (when the server is not completely frozenyet) or forcing a restart (normal sudo reboot doesn’t work also due to the processes) solves the problem temporarily.

I think this might be related to the problem, from log.lxd.1:

t=2020-11-06T21:56:48+0100 lvl=warn msg="Detected poll(POLLNVAL) event." 

I put some info here:
TXT Folder

Could this be due to OOM problems?

I’m not seeing anything wrong here.
Your ps output shows a single lxd process running, consuming about 100MB of RAM and not using much CPU at all. The other entries are primarily processes running in containers.

ps fauxww should paint a clearer picture as to what container the processes belong to, but there’s nothing that looks wrong in your logs or ps output.

If it’s some kind of OOM, then dmesg would be good to have.

Hi, here the htop screenshot I forgot about yesterday and the VNC screenshot when the server wouldn’t even restart, and there it clearly says OOM, so it is that, sorry to have wasted time.
I will set proper limits for this smaller server for the containers to hinder this from happening.
I am curious though: why all the lxd --logfile processes, what do they do at that point?

You’re seeing many lxd --logfile because you haven’t configured your htop to hide threads, so every thread appears as a process making it confusing to read.

And yeah, given you’re completely out of memory, the high CPU usage is expected as things are fighting to stay alive and failing to allocate memory at this point.

1 Like

Thanks for the tip for htop!