Docker containers have one Python GIL?

When I run a Python script inside a Docker container, it completes one run loop after ~ 1 minute. Now when I spin up 2 more containers from one image and run Python scripts inside them, everything slows down to traversal and starts taking 5-6 minutes per cycle.

None of the scripts are resource related; there is a lot of RAM and processor cores sitting around. This happens when running 3 containers on a 64-core Xeon Phi system.

So Docker uses a common Python GIL lock among all containers? What are my options to decouple the GIL so that each process will run at its full potential speed?

Thank!

+3


source to share


1 answer


So Docker uses a common Python GIL lock among all containers?

NOT.



The GIL is a Python process, a Docker container can have 1 or more Python processes, each with its own GIL.

Unless you're multithreading, you shouldn't even know about the GIL. Do you use streams at all?

+2


source







All Articles