From ae0247024178cb1abce71cabbc9ab6732f201e66 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer <jacob@gitlab.com> Date: Mon, 28 Feb 2022 16:03:37 +0000 Subject: [PATCH] Override GIT_STRATEGY in .gitlab-ci.yml This adds a hard-coded 'GIT_STRATEGY: clone' to .gitlab-ci.yml. Without this, misconfigured forks of gitlab-org/gitlab can use the 'fetch' strategy which is bad for the pack-objects cache hit ratio. Without a good hit ratio, such misconfigured forks cause CPU saturation events on the Gitaly server that hosts them. See https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/1584 for more information. --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1531b1d6b9620..c1355e7894591 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -65,6 +65,8 @@ variables: # we override the max_old_space_size to prevent OOM errors NODE_OPTIONS: --max_old_space_size=3584 GIT_DEPTH: "20" + # 'GIT_STRATEGY: clone' optimizes the pack-objects cache hit ratio + GIT_STRATEGY: "clone" GIT_SUBMODULE_STRATEGY: "none" GET_SOURCES_ATTEMPTS: "3" DEBIAN_VERSION: "bullseye" -- GitLab