[DISCUSS][CORE] Should managed off-heap memory take the container limit into account?
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- scala
- Lĩnh vực
- distributed-systems, performance
Hướng nghiên cứu
Bắt đầu với UnifiedMemoryManager và đường dẫn spill hiện có của MemoryConsumer, sau đó xem xét các giá trị đọc cgroup v1/v2 của prototype và các giả định về ngân sách JVM/native. Một kết quả hữu ích là một hướng đi được maintainer phê duyệt — cấu hình executor-overhead, giới hạn hoặc cảnh báo khi khởi động, hoặc phản hồi trong thời gian chạy — tiếp theo là một reproducer tập trung và các bài kiểm thử.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I have been looking at how Spark managed off-heap memory behaves in a memory-limited container.
One thing that seems easy to misconfigure is that these three limits are independent:
container limit: 1500 MiB
JVM max heap: 1024 MiB
spark.memory.offHeap.size: 2048 MiB
spark.memory.offHeap.size is only an upper bound used by Spark's memory manager, so the example
above does not fail immediately. The problem is that UnifiedMemoryManager does not know about the
1500 MiB process limit. If heap, managed off-heap memory, direct buffers, thread stacks, and other
native allocations grow at the same time, the container can kill the executor before Spark gets a
chance to spill.
In that case there may be no useful Java OOM. From outside the container it can just look like:
exit code 137
OOMKilled=true
Using JVM heap occupancy as the feedback signal does not seem right here. It cannot see off-heap
or other native memory, and it moves with GC. The cgroup usage and limit describe the boundary that
actually kills the process.
I made a small prototype that reads cgroup v1/v2 values and uses them to put a lower admission
limit on Spark-managed off-heap memory. At startup the rough budget is:
cgroup limit - JVM max heap - native reserve
The admission limit can then be reduced when total cgroup usage is high. This still relies on the
existing MemoryConsumer and spill code; it does not add another eviction mechanism.
There are some non-obvious details. In particular, setting the limit to zero is not safe because a
task may fail to allocate its first sorter page and throw SparkOutOfMemoryError instead of
spilling. Also, a fixed native reserve is probably too simplistic across different collectors,
core counts, and deployment modes.
Before spending more time on the prototype, I would like to check the expected direction:
- Should Spark use the container limit when admitting managed off-heap allocations, or is this
expected to be handled entirely by executor memory-overhead configuration? - If Spark should handle it, would a startup warning/static cap be preferable to runtime
cgroup-pressure feedback?
If this belongs in Spark Core, I can follow up with a focused reproducer and tests for the approach
maintainers prefer.
- Ngôn ngữ chính
- Scala
- Star
- 44.2k
- Fork
- 29.5k
- Merge trung bình
- 8 giờ 43 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/spark
-
[BUILD] Bump Ivy up to 2.6.0Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[SQL][CONNECT] SparkConnectClient may drop metadata (auth headers) on retried/reattached RPCs if metadata is a non-list iterableCó thể đã có người làm @zainmirzaaa đã nhận 60 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[CORE] bug report: collision of resource profile idCó thể đã có người làm @ybapat đã nhận 86 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
apache/spark#57498 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[BUILD] Drop oro dependencyĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/spark#57209 · 7 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
apache/spark#59659 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 91/100
com-vitthalmirji/toon4s#117 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
zio/zio-blocks#1780 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
digital-asset/participant-query-store#168 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
propensive/soundness#2294 ·
Maintainer thường phản hồi trong vòng 1 ngày