master: RSS grows ~1.5 GiB/h over long uptimes until OOM

Đang mở
#260 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, kubernetes, rust

Hướng nghiên cứu

Start by examining the master's metrics endpoint for memory gauges and task counters. Look at the Session cache implementation and Dataset handle lifecycle in the scheduler. The issue suggests instrumenting cache size and handle counts, then testing changes like dropping handles after scans or adjusting allocator settings.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

lance-context-master resident memory climbs roughly linearly with uptime and the process is OOMKilled at the container limit (32 GiB) every 8–20 hours. Observed on a 3-replica deployment at commit 897a536 with COMPACTION_CONCURRENCY=2, TASK_CONCURRENCY=2, COMPACTION_THREADS=4, COMPACTION_MAX_SOURCE_FRAGMENTS=512, ROLLOUT_CACHE_BYTES=2 GiB, MALLOC_ARENA_MAX=2, STATS_SCAN_INTERVAL_SECS=300, ~7,900 experiments in the registry:

replica uptime cgroup memory
A 3 h 11.2 GiB
B 12 h 23.9 GiB
C 20 h 28.9 GiB

Two replicas were OOMKilled in the same window (after 7.5 h and 16 h). Only 2 compaction tasks were running at the time of each kill, so this is not the compaction fan-out that COMPACTION_CONCURRENCY bounds; it is a slow ratchet.

The mango deployment notes already record an earlier round of this ("compact RSS ratcheted up and never released") that was mitigated with MALLOC_ARENA_MAX=2; that helped but did not remove the growth.

What is known / suspects

  • Growth is independent of COMPACTION_CONCURRENCY (2 vs 4 gives the same slope).
  • Each stats scan touches every experiment (stats scan complete experiments=7917) and each auto-sweep queues hundreds (auto-sweep queued experiments queued=212, auto merge-wal sweep queued experiments queued=80). Candidates:
    • per-Dataset metadata retained across scans (manifest / fragment lists for thousands of datasets) outside the Session cache bounded by ROLLOUT_CACHE_BYTES;
    • Dataset handles kept alive by the scheduler's task state or the stats store between scans;
    • allocator retention after large Compaction task … Read progress N/40000 rewrites (the MALLOC_ARENA_MAX mitigation hints this is part of it).

Proposed next steps

  1. Chart process_resident_memory_bytes from the master's /metrics over 24 h alongside master_task_* counters to see whether growth is smooth or steps at scan / compaction boundaries.
  2. Add a gauge for the Session cache's actual size and the number of live Dataset handles, to rule the bounded cache in or out.
  3. If it is retained Dataset state: drop/reopen per-experiment handles after each scan, or scope them to the scan.
  4. If it is allocator retention: try jemalloc with background purging for the master binary, or a periodic malloc_trim(0) after compaction tasks.
  5. Consider lowering COMPACTION_MAX_SOURCE_FRAGMENTS (512 → 256) as an interim to cut the per-compaction peak.

Independent of #256–#259 (worker-side WAL merge); filing separately so it is tracked.

Ngôn ngữ chính
Rust
Star
89
Fork
21
Merge trung bình
2 giờ 6 phút
Pull request đã merge (30 ngày)
435

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của lance-format/lance-context

Tất cả issue của lance-format/lance-context

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.