I’ve been struggling with a Debian Jessie container for a few days now trying to figure out the reason for the incredibly low performance when executing standard commands like apt-get update
or apt-key add some_key
.
Debian 7, 9 and 10 containers don’t suffer from this problem. It’s only Debian 8 I’m having problems with. I even tried upgrading a Debian 7 container to Debian 8 and as soon as it is upgraded it starts performing very slowly.
My test system is freshly installed Ubuntu 16.04 (4.13.0-36-generic) running on VirtualBox. LXD is configured to use ZFS, but I also tested with folder based storage and got the same bad results. LXC version is 2.0.11. I didn’t do anything special. Just installed Ubuntu, updated all packages, configured LXD and created one Debian 8 and one Debian 7 container to test with.
I also tried with a nightly snapshot of Ubuntu 18.04 as host, but still no luck. Privileged vs unprivileged didn’t make any difference too. Upgrade of container systemd from backports - again no improvement.
This is what I get on Debian 7
root@deb7:~# time apt-key add some_key
OK
real 0m0.075s
user 0m0.031s
sys 0m0.043s
Compare it to a Debian 8 container
root@deb8:~# time apt-key add some_key
OK
real 0m30.640s
user 0m8.758s
sys 0m21.853s
Strace output from both commands
Debian 7: https://gist.github.com/anonymous/3e3f447206eda40860edb181ddacd30a
Debian 8: https://gist.github.com/anonymous/6402e15f59fe8a8791f42dc26821d82f
It seems to be stuck at read
, but I’ve also seen it staying on select
for way too long, when doing apt-get update
for example. By the way strace doesn’t actually print the full read
line all at once. It’s more like 23:54:08 read(4,
then 3-4 seconds later "APT_DIR='/'\n", 128) = 12
.
Containers were created like this
lxc launch images:debian/7/amd64 deb7
lxc launch images:debian/8/amd64 deb8
Images used:
+-------+--------------+--------+--------------------------------------+--------+----------+-------------------------------+
| ALIAS | FINGERPRINT | PUBLIC | DESCRIPTION | ARCH | SIZE | UPLOAD DATE |
+-------+--------------+--------+--------------------------------------+--------+----------+-------------------------------+
| | a80feddb74c6 | no | Debian jessie amd64 (20180223_03:44) | x86_64 | 102.77MB | Feb 23, 2018 at 11:09pm (UTC) |
+-------+--------------+--------+--------------------------------------+--------+----------+-------------------------------+
| | 1793426a062e | no | Debian wheezy amd64 (20180222_22:42) | x86_64 | 92.65MB | Feb 23, 2018 at 11:08pm (UTC) |
+-------+--------------+--------+--------------------------------------+--------+----------+-------------------------------+
I have no idea how to resolve or even to properly troubleshoot this problem. Any help is much appreciated. Has anyone else experienced this? I’m able to reproduce this consistently on freshly installed system.