increase pipeline docker shm_size setting
Problem to solve
As a project owner using CI pipelines, I want the shm_size setting of the docker container to be much larger than its current (64MB) default, so that applications such as firefox and databases running in my pipeline scripts do not fall over trying to use /dev/shm .
Intended users
DevOps Engineer
User experience goal
I would like the default shm_size in CI pipeline docker images to be much larger than the current 64MB. An obvious size to pick would be "close to the allocated memory of the docker container", since that is an upper bound on how much tmpfs can be allocated.
Proposal
- look at the current memory settings of the shared gitlab runners. (appears to be 3.6GB for the ones on gitlab.com that my pipelines are running on)
- add "shm_size=3.6G" to the arguments list of the docker create command that creates the docker containers for the gitlab runners on gitlab.com
Further details
There are a number of utilities that make use of /dev/shm, for which the default 64MB size is inadequate under load. (Firefox is a particular problem for me, but other utilities such as databases also are affected).
This is also implicitly mentioned as a problem in #216211 (closed)
Changing the shm_size setting for the docker containers should have no impact on resources - it does not change the size of the docker image, or the memory use of the docker container; it merely allows allocation within the tmpfs up to the limit of that container's memory allocation.
Permissions and Security
There is no change to permissions and security - this does not alter what resources are available to users, nor does it involve any UI/API or other access method changes.
Documentation
The shm_size setting in docker images does not appear to be documented anywhere (nor does the default setting of allocated memory for docker containers in the shared runners that gitlab.com provides).
Availability & Testing
I do not believe this introduces any risks.
What does success look like, and how can we measure that?
People running CI pipelines will see fewer unexplained crashes of applications that make use of /dev/shm, such as firefox, database servers and clients, etc.