Kubernetes pod is much slower than same image running as docker container

148 views Asked by At

I had a docker image build based on yolov5 with some additional code.

For the same build image, if the image is run in docker using

docker run --rm yolo-custom --env my_id=123

output 
Yolo Prediction Done. (0.467s)

The prediction for each image takes less than 0.5 using cpu

However, on the same instance where the docker is run, if I create a kubernetes deployment running the same docker image. The prediction is at least >3s

output
Yolo Prediction Done. (3.300s)

Yolo Prediction Done. (11.197s)

And, if I run more than 1 instance of the kubernetes pod, the 2nd or 3rd pod will go as high as 40s or more.

Both container are run in the same instance of backend server.

I would expect the kubernetes pod to run close to the time run in a docker container

0

There are 0 answers