Rails takes awhile to boot, let's see if we can improve this
Summary
When rails starts, whether it be the app, a console, etc, it takes nearly 1 minute to start. When used with other wrapper scripts such as those used to power the application in Docker Containers, only adds to this amount of time. Recent improvements, such as the use of bootsnap, have made Kubernetes start up times quicker, though those improvements only impact our Docker images. And, due to the use of multiple initContainers, many of which require the rails application to start, add up to lengthy start times in Kubernetes. This has the potential to lead to large issues.
- Scaling inside of Kubernetes is slower than desired.
- Development productivity is potentially hindered
- etc
Steps to reproduce
From a stopped application, start one component of GitLab, example, gitlab-ctl start puma
Observe that it takes roughly 50 seconds to start up.
In Kubernetes, Pods can take nearly 2 minutes to complete all initContainers and transition into a Running state.
Reference
Some research into start times for rails has been completed here: gitlab-org/charts/gitlab#1946 (comment 319270293)