Running a VM that's running Docker - it's really slow

Aug 6, 2019
22
1
8
54
Hi,

I have a Proxmox machine that has quite a beefy spec - 256Gb RAM, a few SSDs and HDs and dual Xeon(R) CPU E5-2640. It's a powerful machine and Proxmox runs everything I throw at it. Until recently.

I used to use an i5 Shuttle with 8Gb of RAM and a 1tb hard disk as my Docker server running on Ubuntu 18.04. As an experiment I decided to build a VM with Ubuntu 18.04 and install Docker on it. I then transferred over my docker-compose.yaml file. I didn't copy any data at this point. I started up my docker stack and off it went. I tried some simple things like loading NextCloud. On the i5 it's instant. On the VM it takes about 40 seconds. I did some basic troubleshooting and did things like running htop and it didn't seem to be struggling. It's just running containers really slowly. After a few more experiments with settings I now have a VM with 16 cores and 64Gb of memory and it still runs really slowly. In fact, none of the iterations on the way to this machine made any difference. The OS itself seems to be running fine but something about virtualising Docker is causing Docker - I assume - problems.

Has anyone else set up a VM to run Docker? If it worked for you were there any extra steps you took?

Just to be clear - I know I only mentioned NextCloud but this is all the web based containers. They're super fast on the i5 machine but really slow on the VM. No diagnostic tools or the graphs in Proxmox appear to show that this now heavily over-spec'd VM is struggling. It just seems to having trouble serving the web front ends of the containers.

Thanks in advance for any pointers anyone can give.

Steve
 
Could you post the config of your VM?

Code:
qm config VMID
 
This is it's CURRENT config - as I said there has been fiddling and tweaking going on.


Bash:
root@pve:~# qm config 908
agent: 1
bootdisk: scsi0
cores: 4
ide2: local:iso/ubuntu-18.04.3-live-server-amd64.iso,media=cdrom
memory: 65536
name: externaldocker
net0: virtio=2E:24:A2:30:05:69,bridge=vmbr0,firewall=1,tag=9
numa: 0
onboot: 1
ostype: l26
scsi0: local-lvm:vm-908-disk-0,size=500G
scsihw: virtio-scsi-pci
smbios1: uuid=68b3a8be-cf24-42ba-b26b-f9b33c062ab4
sockets: 2
vmgenid: 0b93816c-961b-442b-a613-db7d17521885

I've just visited the Nextcloud webpage in a new browser window and while it's still loading the Proxmox summary for the VM at the moment says it's using 0.90% of 8 CPUs and 21.52% of 64GB so as I said I can't figure out what it thinks it's doing.

Steve
 
Your configuration looks ok. It could be that parts of your Docker stack interfere with parts of the KVM virtualization. Unfortunately, I'm not an expert in Docker.

It might help to run benchmarks on your Shuttle and in the VM. If this does not show a general performance problem in the VM, taking a look at hints for setting up Docker in a virtual environment might be worth a shot.
 

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!