5

I'm running a python Flask server which is doing face recognition with https://github.com/ageitgey/face_recognition.

The face_encodings function is taking 10 times longer when running through docker in comparison to just starting the server in my machine and I have no idea why.

I think the most important part of my Dockerfile is this:

FROM python:3.6-slim-stretch

RUN cd ~ && \
    mkdir -p dlib && \
    git clone -b 'v19.9' --single-branch https://github.com/davisking/dlib.git dlib/ && \
    cd  dlib/ && \
    python3 setup.py install --yes USE_AVX_INSTRUCTIONS

Am I doing something wrong? Why is the docker container so much slower? Am I installing dlib in a wrong way?

Rodrigo Ruiz
  • 4,248
  • 6
  • 43
  • 75
  • Does the container have limited access to the CPU and Memory of the host machine? – JacobIRR Aug 08 '18 at 17:43
  • Would that be a configuration in the `Dockerfile`? How do I know if it has that limitation? But even if that was the case, the code is using a single core, since I'm processing only one image. – Rodrigo Ruiz Aug 08 '18 at 17:52
  • The docker app (daemon) running on your machine has configuration options for how many resources docker is allowed to use. – JacobIRR Aug 08 '18 at 17:54
  • CPUs is at 4, memory at 2GB and Swap at 1GB – Rodrigo Ruiz Aug 08 '18 at 20:06

0 Answers0