summaryrefslogtreecommitdiff
path: root/f3s/git-server/helm-chart/templates/configmap-cgit.yaml
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-07-26 00:35:39 +0300
committerPaul Buetow <paul@buetow.org>2026-07-26 00:35:39 +0300
commit424a3cf07654a9a323cf8591c2ebf9ee177a3fdd (patch)
tree2167197b84b0cd59a0b3a35185d57227e6b6b43d /f3s/git-server/helm-chart/templates/configmap-cgit.yaml
parentde406f3145b07a6bfdd62d2e223075d9d20fa1eb (diff)
git-server: cut cgit render time by enabling its response cache
cgit ran with cache-size=0 against scan-path over ~80 repos on NFS, so every request reopened all of them to resolve the index age column. Measured 376ms per index render, of which only ~50ms was CPU -- the rest was NFS wait. With the cache enabled the same render takes ~19-29ms. cache-root points at the existing node-local cgit-runtime emptyDir rather than the NFS-backed /repos; caching onto NFS is what the old "permission issues" comment was actually about. The startup script creates the directory since cgit does not. fcgiwrap ran as a single worker, so the 26 ArgoCD apps polling conf.git through git-http-backend serialized against web UI renders; 4 concurrent requests managed only ~1.5x the throughput of one. Preforking 4 workers separates them. The cgit container also idled at 105m against a 250m limit and had accumulated ~2.9h of throttled time (nr_throttled 96979), so raise the ceiling and set the request from measured idle usage. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'f3s/git-server/helm-chart/templates/configmap-cgit.yaml')
-rw-r--r--f3s/git-server/helm-chart/templates/configmap-cgit.yaml19
1 files changed, 17 insertions, 2 deletions
diff --git a/f3s/git-server/helm-chart/templates/configmap-cgit.yaml b/f3s/git-server/helm-chart/templates/configmap-cgit.yaml
index 519ab26..7dda693 100644
--- a/f3s/git-server/helm-chart/templates/configmap-cgit.yaml
+++ b/f3s/git-server/helm-chart/templates/configmap-cgit.yaml
@@ -15,8 +15,23 @@ data:
# Set the virtual root for correct URL generation
virtual-root=/
- # Disable caching to avoid permission issues
- cache-size=0
+ # Response cache. With scan-path over ~80 repos on NFS, an uncached render
+ # reopens every repo to resolve its age column: measured 376ms per index
+ # page, 87% of it NFS wait rather than CPU. Caching drops that to ~19-29ms.
+ # cache-root must be node-local and writable by UID 33 -- it points at the
+ # cgit-runtime emptyDir mounted on /tmp, NOT at the NFS-backed /repos
+ # (caching on NFS is what originally caused the permission trouble here).
+ # The startup script in deployment.yaml creates the directory.
+ cache-root=/tmp/cgit-cache
+ cache-size=1000
+
+ # TTLs in minutes; these are cgit's defaults, stated explicitly so the
+ # staleness window after a push is visible rather than implied.
+ # Static pages are keyed by commit SHA, so they never need to expire.
+ cache-root-ttl=5
+ cache-repo-ttl=5
+ cache-dynamic-ttl=5
+ cache-static-ttl=-1
# Enable git-config for per-repo settings
enable-git-config=1