I'm working on a personal project related to face recognition, specifically using a test tool called FaceSeek. My aim was to see how image processing performs inside a Docker container compared to outside it. Surprisingly, while everything runs smoothly outside the container, I've noticed a significant slowdown when running it inside Docker. I've checked the usual suspects like resource limits, volume bindings, and permissions, but nothing seems off. I'm curious if anyone else has encountered similar performance issues with intensive tasks like image analysis in containers and would love some technical insights on how Docker manages such workloads, especially regarding CPU and GPU utilization.
1 Answer
If you're running on Docker Engine without using Docker Desktop, performance should ideally be the same as if it were running directly on your machine. However, if you’re using Docker Desktop, which runs containers in a VM, that could be where the slowdown is coming from. This is especially true on ARM CPUs like the recent Apple silicon, where emulation can add more delay if the images aren’t optimized for that architecture. Also, keep in mind, if your workload relies on GPU, you'll need to enable that explicitly; otherwise, you'll see a pretty big drop in performance.

That's a good point! I also heard that on Windows with Docker Desktop, the WSL VM can contribute to slow performance, particularly if you're mounting Windows file paths, which adds a filesystem translation layer. Definitely worth checking!