Page MenuHomePhabricator

gitlab behind CDN: serve gitlab.wm.o via text-lb instead of dedicated IPs?
Closed, ResolvedPublic

Description

In T425441: gitlab behind CDN we initially followed the Gerrit playbook. But, we recently have decided to move Gitlab's SSH to gitlab-ssh.wikimedia.org, resolving directly to the GitLab hosts. The CDN will only serve HTTPS, which removes the original reason for dedicated IPs on the CDN.

If we chose to serve gitlab.wikimedia.org with text-lb instead of dedicated loadbalancers, as highlighted in this comment, we could:

  • abandon the catalog + Liberica changes (in that relation chain)
  • return the 14 unused gitlab-lb IPs

As discussed with @ssingh on IRC, this task is to address the following concerns:

  • Any capacity or isolation concern with git-over-HTTPS traffic on text-lb?
  • In {T365259} the conclusion was "as far as HTTPS is concerned, the CDN is Gerrit" , Gitlab will be in the same situation (only for HTTPS). Is it OK?

Event Timeline

ABran-WMF changed the task status from Open to In Progress.Jun 11 2026, 1:24 PM
ABran-WMF triaged this task as High priority.
ABran-WMF moved this task from Incoming to Work in Progress on the Collaboration-Services board.

Any capacity or isolation concern with git-over-HTTPS traffic on text-lb?

No direct concerns but I have two things for consideration:

  • We generally tend to keep text-lb strictly for text but of course that ship has long sailed anyway. What we try to do is not introduce new things that may affect text-lb and its primary purpose, so that's something to keep in mind. (And yes, in that case you don't need a separate service entry, just the Varnish and ATS configs for the backend.)
  • We should be cautious of timeouts here -- I presume that in some cases we will have long-lived HTTP requests for some of the repositories? That, like the Gerrit thing, is something to be mindful about.

Adding @BBlack for his input.

Well, for this and other similar use-cases, I'd clarify that while technically it is cache_text servicing the requests, it's really cache_misc which happens to be a sub-unit of VCL within cache_text today. We should still eventually re-separate these clusters physically for a whole host of reasons.

Long timeouts and very bulky transfers are definitely a concern, so long as cache_misc continues to be part of cache_text. If they're rare it probably won't be an issue in practice. Some thought should be put into looking at the edge cases, though: what's the biggest repo in gitlab? How long does it take to clone that on some exacmple connection types?

what's the biggest repo in gitlab?

I think I can answer this one. It's 98.8 GB for Thcipriani / Flaky Tests.

The top ten are by size, in GB

98.8
39.0
27.6
16.1
13.8
13.2
12.3
12.2
12.1
9.1

Well, for this and other similar use-cases, I'd clarify that while technically it is cache_text servicing the requests, it's really cache_misc which happens to be a sub-unit of VCL within cache_text today. We should still eventually re-separate these clusters physically for a whole host of reasons.

Yes thanks for clarifying that, and yeah, we should certainly make progress on those...

Long timeouts and very bulky transfers are definitely a concern, so long as cache_misc continues to be part of cache_text. If they're rare it probably won't be an issue in practice. Some thought should be put into looking at the edge cases, though: what's the biggest repo in gitlab? How long does it take to clone that on some exacmple connection types?

While we get clarity on that, note that one possible path forward is that we set and tune this on a per-map basis, so essentially:

params:
  - '@plugin=/usr/lib/trafficserver/modules/conf_remap.so'
  - '@pparam=proxy.config.http.transaction_no_activity_timeout_out=16'
  - '@pparam=proxy.config.http.transaction_active_timeout_out=16'

Thanks @Dzahn @ssingh @BBlack for these answers, using cache_misc will greatly simplify things.

I've amended 1290731 with a tuning proposition to allow cloning large repositories.

params:
  - '@plugin=/usr/lib/trafficserver/modules/conf_remap.so'
  - '@pparam=proxy.config.http.transaction_no_activity_timeout_out=300'
  - '@pparam=proxy.config.http.transaction_no_activity_timeout_in=300'
  - '@pparam=proxy.config.http.transaction_active_timeout_out=3600'
  - '@pparam=proxy.config.http.transaction_active_timeout_in=3600'

Parameters are inspired from profile::trafficserver::backend::http_settings for cache hosts, with an additional time for no activity to leave some time for Gitaly to generate packfiles.

I think we could also recommend using SSH for these.

Maybe let me also ask @thcipriani if 98.8 GB Thcipriani / Flaky Tests is expected, needed and growing, given how the second largest is less than half the size.

Maybe let me also ask Tyler if 98.8 GB Thcipriani / Flaky Tests is expected, needed and growing, given how the second largest is less than half the size.

@Jelto asked me about that repo long ago. I actually rewrote history on that repo to remove large files and force pushed. Current local repo size is 500MB. GitLab never reclaimed that space, though, it seems. (edit for clarity) Delete the lfs storage for that repo if it's possible to do so. It's inaccessible from the repo itself.

Oh, interesting. Thanks for the explanation @thcipriani. Yea, I was only looking at actual file system. So GitLab has not reclaimed the space.

edit: I have to correct myself. This was not by file system but by GitLabs own admin web UI and sorting by storage_size here:

https://gitlab.wikimedia.org/admin/projects/?sort=storage_size_desc

I ran this trying to fix it:

[gitlab1004:~] $ sudo gitlab-rake gitlab:cleanup:orphan_lfs_files PROJECT_PATH="thcipriani/flaky-tests"
I, [2026-06-15T17:17:20.263913 #2917681]  INFO -- : Removed unreferenced LFS files: 0

Let me continue elsewhere to not pollute this general ticket with the details.

Oh, interesting. Thanks for the explanation @thcipriani. Yea, I was only looking at actual file system. So GitLab has not reclaimed the space.

Looked up the steps on: https://docs.gitlab.com/user/project/repository/repository_size/#clean-up-repository

  1. git filter-repo to remove large file references
  2. Upload the commit-map and run Repository Cleanup under Settings for the repo.

I did the git filter-repo back in Oct 2025. But never uploaded the commit-map and ran repo cleanup. I still have the commit-map so I just uploaded it and ran Start cleanup. Maybe that'll get rid of the LFS files. The docs say git objects will be held for two weeks, but given this is LFS storage, not git objects, it's unclear.

Email just now:

Repository cleanup succeeded on https://gitlab.wikimedia.org/thcipriani/flaky-tests

Repository size is now 0.3 MiB

ABran-WMF claimed this task.

This is essentially resolved, the pending change will be merged tomorrow, advertising the new URL for SSH git commands.