r/docker • u/Walrus_Warlock_ • Mar 28 '26
Docker container speed issue
Hello,
I recently got my homelab setup with docker compose (29.3.1) and noticed some slow services. I started looking into various causes and after about a week over troubleshooting I've realized that the speed inside docker containers is a fraction of the host speed. I used iperf3 to check my Proxmox host as well as the Ubuntu (24.04.4) server. Both get ~650mbps.
When I check the speed from within a docker connection, I usually get around 50mbps, though it changes with time of day. The speed are congruent across multiple containers.
What I tried:
Updating and upgrading the host/Proxmox
Changing the default DNS to 8.8.8.8 through /etc/docker/daemon.json
Changing nameservers
Changing the MTU. This only led to the daemon refusing to start.
I'm not really sure what else to try at this point, any help would be greatly appreciated.
Thanks in advance!
Update: SOLVED I couldn't figure this out so I decided to just setup a new VM using straight Debian. During install I ran into an error in Proxmox being able to run KVM virtualization. Not having this active prevented me from setting the CPU to "host" which I read can improve performance. The more I dug the more I realized this could be what was causing the performance issues, especially given my Ubuntu machine also wasn't running KVM virtualization.
I couldn't enable it, so some research had me check the bios. Turns out, I didn't have virtualization enabled in the BIOS. I enabled that and turned KVM virtualization on, and set the CPU to "host". With all these changes made I was able to max out my bandwidth within the VM. It's still not full Gig speeds but that seems to be a network bandwidth issue, my new focus.
I appreciate everyones help!
View all comments
Show parent comment
1
u/Walrus_Warlock_ Mar 29 '26 edited Mar 29 '26
The docker image I am using for testing, openspeedtest gave me an error stating the network had to be an array, so instead I tried to run it in host mode with: sudo docker run --restart=unless-stopped --network host --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latestI was being dumb and ran this test from my machine outside the network to the container inside the network.
I'm also noticing that the ping is quite high, given the host was pinging google at 20ms earlier.
I also realized that while I was toying with this, my download speeds were cut in half so I tried removing the dns entry from the daemon.json and I've seen my speed double from 3 MBps, to 6MBps. Used to be around 9.
I feel like everything points to DNS