Skip to content

fix(k8s): replace the SearXNG worker before its memory limit - #4951

Merged
dan-petty merged 2 commits into
mainfrom
fix/4939-searxng-worker-memory
Nov 12, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/4939-searxng-worker-memory

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The SearXNG worker grew about 50 MiB a day and was never replaced. In 4 days its resident memory rose from 160 MiB to 364 MiB against the limit of 384 Mi, and the container was OOM-killed on 2026-11-12.

Granian 2.8.4 in the pinned image replaces a worker that passes GRANIAN_WORKERS_MAX_RSS. The Deployment sets it to 512 MiB, and the memory request and limit go to 256 Mi and 1 Gi, so the main process, the resource tracker, a worker at the cap and its replacement fit. "The limits" in k8s/README.md and the SearXNG invariant tests hold the new values.

Closes #4939

Change: openspec/changes/archive/2026-11-12-4939-searxng-worker-memory/

The SearXNG worker grew about 50 MiB a day and was never replaced, so
it reached the 384 Mi limit and the container was OOM-killed. Granian
now replaces a worker that passes 512 MiB (GRANIAN_WORKERS_MAX_RSS),
and the memory request and limit are 256 Mi and 1 Gi, so a worker at
the cap and its replacement fit.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Nov 12, 2026
@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 06:36
@dan-petty
dan-petty enabled auto-merge (squash) November 12, 2026 06:36
@dan-petty
dan-petty merged commit 95abe10 into main Nov 12, 2026
23 checks passed
@dan-petty
dan-petty deleted the fix/4939-searxng-worker-memory branch November 12, 2026 06:37
@dan-petty

Copy link
Copy Markdown
Owner Author

Fail-to-pass: uv run devops ci fail-to-pass --base origin/main on head 06cc4b5bd (before the rebase onto 6d93d77):

  • failed on base: tests.invariants.test_k8s_searxng::test_the_environment_holds_the_server_secret_from_the_secret_and_an_ipv4_bind (the environment has no GRANIAN_WORKERS_MAX_RSS)
  • failed on base: tests.invariants.test_k8s_searxng::test_the_container_has_requests_and_limits (192Mi/384Mi)
  • 2 failed and 23 passed on base, 0 errored; all 25 pass on the change (uv run pytest tests/invariants/test_k8s_searxng.py).

Live facts: Prometheus rss 160 to 364 MiB over 4 days (cache under 1 MiB); lastState.terminated.reason: OOMKilled at 2026-11-12T05:26:00Z; after the restart, worker 90 MiB, main process 31 MiB, resource tracker 12 MiB. granian --help in the pinned image lists --workers-max-rss (env GRANIAN_WORKERS_MAX_RSS).

After the merge, Argo CD syncs the Deployment. Check: kubectl -n devops get pod -l app.kubernetes.io/name=searxng -o jsonpath='{.items[0].spec.containers[0].resources}' shows 256Mi/1Gi, and the worker RSS in Prometheus drops back when it passes 512 MiB.

dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.117.0](v0.116.2...v0.117.0)
(2026-11-12)


### Features

* **git:** refuse a push that does not hold origin/main
([#4879](#4879))
([f55a20b](f55a20b)),
closes [#4670](#4670)


### Bug Fixes

* **k8s:** replace the SearXNG worker before its memory limit
([#4951](#4951))
([95abe10](95abe10))
* **mcp:** mark the tools that write local state not read-only
([#4942](#4942))
([6d93d77](6d93d77))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(k8s): SearXNG worker memory grows to its limit

1 participant