Farhad Emami
Farhad Emami

Reputation: 1

Docker can slow down your code and distort your benchmarks

I just got informed today that there was a problem that when we run a python code on a container, it will be slower than running it on the host. More details about this problem is on the following link:

https://pythonspeed.com/articles/docker-performance-overhead/

this Article is for 2021 and its solution was to run container with privilleged access or set Seccomp as unconfined which is strongly suggested no to do so security wise. Now in 2024 I just want to see if the problem is solved or is another solution found for that?

I just got curious to know if there is a better solution for that

Upvotes: 0

Views: 774

Answers (2)

julaine
julaine

Reputation: 1724

"Now in 2024 I just want to see if the problem is solved" -> the answer to that is no.

Both issues linked in the blog-post related to the performance overhead of seccomp are still open. https://github.com/docker-library/python/issues/575
https://github.com/moby/moby/issues/41389

For mitigations and explanations see here: Docker 50% performance hit on cpu intensive code

Upvotes: 0

Lars
Lars

Reputation: 3930

Docker is not a virtualisation/emulation. The Process running inside your Docker Container runs with the same speed as if it runs directly on your computer machine. There will be a little overhead in I/O but nowadays this difference is negligible.

Upvotes: -2

Related Questions