Skip to content

GiteaAPISlow

Severity: warning. Fires when the Gitea API probe has taken more than 2 seconds for 10 minutes. This was the 2026-10-20 case: API calls took 3–10 s and CI jobs were lost. Left alone it turns into lost Actions jobs, failing Flux fetches and a ProbeFailed once requests pass the 5 s probe timeout.

Labels: instance (https://gitea.prod.skatzi.com/api/healthz), component: gitea, job: gitea-api.

The probe calls /api/healthz, which pings Gitea's PostgreSQL and its cache. Gitea runs with REQUIRE_SIGNIN_VIEW, so every anonymous /api/v1 call is refused and this is the only anonymous API call that reaches the database; a slow probe means a slow Gitea process, database connection or database.

Read-only checks

# Where the time goes: connect, TLS, processing (time to first byte), transfer
BB=/api/v1/namespaces/monitoring/services/http:blackbox-exporter:9115/proxy
kubectl --context admin@mgmt-cluster get --raw "$BB/probe?module=http_2xx&target=https://gitea.prod.skatzi.com/api/healthz&debug=true" | grep -i duration

# Is it Gitea or everything? Compare with other hosts' probe_duration_seconds
curl -s 'https://prometheus.prod.skatzi.com/api/v1/query?query=probe_duration_seconds' | jq -r '.data.result[] | "\(.value[1]) \(.metric.instance)"' | sort -rn | head

# Gitea and its database: restarts, CPU throttling, memory
kubectl --context admin@mgmt-cluster -n gitea get pods
kubectl --context admin@mgmt-cluster -n gitea top pods
kubectl --context admin@mgmt-cluster -n gitea logs deploy/gitea --since=30m | grep -i -E 'slow|timeout|error' | tail -20
kubectl --context admin@mgmt-cluster -n gitea logs statefulset/gitea-postgresql --since=30m | tail -20

Typical reasons: CPU throttling or memory pressure of the Gitea pod, a busy or failing-over PostgreSQL, a burst of Actions or Renovate traffic, or a slow node.

Roll forward

Fix the cause in Git in a pull request: resources of Gitea or its database, or the load that causes it (e.g. Renovate's schedule). If Gitea is slow after an upgrade, follow the ops runbook's triage order.

Roll back

If the slowness started with a Gitea or PostgreSQL change in Git, revert that pull request; Gitea's database migrations do not roll back, so for an upgrade with a migration follow the generic Flux freeze instead of downgrading the image.