Unexplainable delay in LXC container

Tony

Renowned Member
Nov 4, 2010
113
10
83
Hi,

I run a Proxmox VE cluster with mostly VMs and they work very well. Recently I created 2 CTs, because I want to bind-mount some ZFS dataset from host to the CTs. The CTs seem to work as expected, except that there is often a delay of a few seconds after some command. Examples:

(1) ssh login (note: I checked ssh config, UseDNS and GSSAPIAuthentication is set to no):
Code:
ssh  -v root@192.168.110.201
.
.
Authenticated to 192.168.110.201 ([192.168.110.201]:22).
debug1: setting up multiplex master socket
debug1: channel 0: new [/Users/tony/.ssh/master-root@192.168.110.201:22]
debug1: channel 1: new [client-session]
debug1: Entering interactive session.
debug1: pledge: id
<delay 25-30secs>
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Remote: /root/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /root/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Sending environment.
debug1: Sending env LC_TERMINAL_VERSION = 3.4.8
debug1: Sending env LC_CTYPE = en_US.UTF-8
debug1: Sending env LC_TERMINAL = iTerm2
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_ALL = en_US.UTF-8
Linux ct-pbs 5.4.78-2-pve #1 SMP PVE 5.4.78-2 (Thu, 03 Dec 2020 14:26:17 +0100) x86_64
root@ct-pbs:~#

(2) install some package
Code:
apt install wget
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be upgraded:
  wget
1 upgraded, 0 newly installed, 0 to remove and 43 not upgraded.
Need to get 964 kB of archives.
After this operation, 1024 B disk space will be freed.
Get:1 http://ftp.debian.org/debian bullseye/main amd64 wget amd64 1.21-1+deb11u1 [964 kB]
Fetched 964 kB in 0s (18.1 MB/s)
<delay 25-30secs>

Any idea what I can try to debug this problem? I already did some disk io tests inside the CT, they seem to be ok.
 
I just happen to create my first debian 11 container last night and noticed the same thing as well. I normally used ubuntu 20.04 containers and never noticed these issues
 
There are two commands I have been running to fix this. I am not at home now and won't be back until about a couple of hours.

EDIT: I found the commands.
systemctl mask systemd-logind
pam-auth-update > deselect "Register user sessions in the systemd control group hierarchy"
 
Last edited:
There are two commands I have been running to fix this. I am not at home now and won't be back until about a couple of hours.

EDIT: I found the commands.
systemctl mask systemd-logind
pam-auth-update > deselect "Register user sessions in the systemd control group hierarchy"
thank you so much, this fixed the issue.
 
  • Like
Reactions: generalproxuser
Do the containers in question have nesting in the options enabled?
If not, enable it and try again.
 
  • Like
Reactions: silverstone
solved for me, thanks Neobin

For whatever reason, ticking the nesting option and rebooting the CT seemed to fix the delay.
 
  • Like
Reactions: Neobin
Even with nesting enabled I'm running into the same issue on a container for Nextcloud also using Debian. Always rough when something that solves a problem for everyone else doesn't solve it for you, despite it being the same issue.
 
Even with nesting enabled I'm running into the same issue on a container for Nextcloud also using Debian. Always rough when something that solves a problem for everyone else doesn't solve it for you, despite it being the same issue.

Afaik, another common cause can be, that if you set the LXC to use IPv6 DHCP, but there is no server within the network present providing it.
 
Another one is locale. It’s always set as generic in LXC and this weirdly causes a lot of delays/lag in certain commands such as apt. If you’re running docker inside LXC (yes yes, I know it’s not recommended), this also fixes the problem of the docker service not starting automatically on LXC startup.

Run on Proxmox host​

dpkg-reconfigure locales

Run inside LXC​

locale-gen en_US.UTF-8

(substitute US with your own locale - mine is AU for Australia)
 
Last edited:

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!