Do ruby gi lmitations apply to docker containers
Memory overhead aside. If I create 5 docker containers with ruby in them on a quad core machine can I run the instances without any worry of running into issues with the gil/mri. For example I load up 5 containers each, with the official ruby image and a simple app that increments an array (not using mutex.synchronize) several hundred times. should I be able to expect these to work consistently? I don’t consider myself a ruby expert, but I have done several basic experiments and have not had any weirdness occur. I would be interested in other types of tests I could run and see for myself if nobody more well versed in Ruby has a answer. The question posed here Is docker a possible solution to ruby GIL limitation in rails? was informative but it did not really seem to answer my question.
One Solution collect form web for “Do ruby gi lmitations apply to docker containers”
The Global Interpreter Lock (GIL) only applies within one process.
You run multiple instances of Ruby. Each process get it’s own GIL and will be able to do work in parallel. Of course, these instances also won’t share any memory and state.
This is independent of docker. As long as you run in multiple Ruby process, they won’t block each other on the GIL.