Skip to content

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

Closed

Description

@dan-petty

What happened?

The SearXNG pod in devops grows its worker memory until the container limit kills it. Over 4 days (2026-11-08 to 2026-11-12) the resident memory of the container rose from 160 MiB to 364 MiB against the limit of 384 MiB (container_memory_rss, nearly all of the working set; the page cache stayed under 1 MiB). On 2026-11-12 05:26 UTC the container was OOM-killed (an extra process from a kubectl exec took the last headroom). After the restart the worker used 90 MiB.

The growth is not load. The sizing note in k8s/README.md ("The limits") measured 114 MiB idle, 117 MiB for 20 queries in sequence and 122 MiB for 10 at once. The worker (searxng worker-1, Granian 2.8.4) grows about 50 MiB a day and is never replaced, so each pod reaches its limit in about 5 days.

What should happen?

  • The pod never reaches its memory limit from slow growth of one worker.
  • The limits have headroom for the measured peak and for the growth between two worker replacements.

Proposed fix

  • Granian 2.8.4 in the pinned image has --workers-max-rss (env GRANIAN_WORKERS_MAX_RSS, MiB): Granian replaces a worker that passes the value. Set it to 512.
  • Raise the memory request to 256 Mi and the limit to 1 Gi, so the main process, the resource tracker and a worker at 512 MiB fit with room during a replacement. The node has 64 GiB with 13 % requested; the namespace has no quota.
  • Update "The limits" in k8s/README.md.

Evidence

  • kubectl -n devops top pod showed 368 Mi of 384 Mi before the kill; lastState.terminated.reason is OOMKilled at 2026-11-12T05:26:00Z.
  • Prometheus, 6-hour steps over 4 days: rss 160, 176, 231, 253, 273, 275, 272, 272, 273, 272, 271, 283, 286, 339, 321, 332, 364 MiB.
  • granian --help in the image lists --workers-max-rss and --workers-lifetime.

Activity

  1. added
    source/agent
    type/bug
    scope/k8s
    status/new
    value/high
    effort/low
    on Nov 12, 2026
  2. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P1-High. A production service is OOM-killed every five days, causing repeated downtime.
    • Value: High. Restores continuous availability of the SearXNG search service.
    • Effort: Low. Set one env var, change two YAML numbers, and update one README section.
    • Related: fix(k8s): raise the memory limit of roadmap-service #4149, which asks for a different change. Both fix a k8s memory-limit OOM for a specific service, but #4149 targets roadmap-service while this targets SearXNG.
  3. added
    priority/p1-high
    on Nov 12, 2026
  4. added
    priority/p2-medium
    and removed
    priority/p1-high
    on Nov 12, 2026
  5. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 12, 2026
  6. removed
    status/in-progress
    owner/agent
    on Nov 12, 2026
  7. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor
  8. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-12 07:00 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/k8ssource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions