[DISCUSS][CORE] Should managed off-heap memory take the container limit into account?
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Tranquilla
- Stack tecnologico
- scala
- Ambito
- distributed-systems, performance
Direzione di ricerca
Inizia con UnifiedMemoryManager e il percorso di spill esistente di MemoryConsumer, quindi esamina le letture cgroup v1/v2 del prototipo e le ipotesi sul budget JVM/native. Un risultato utile sarebbe una direzione approvata dai maintainer — configurazione dell’executor-overhead, un limite o un avviso all’avvio, oppure feedback a runtime — seguita da un reproducer mirato e da test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Scala
- Stelle
- 44.2k
- Fork
- 29.5k
- Merge medio
- 8h 43m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/spark
-
[BUILD] Bump Ivy up to 2.6.0Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 2 giorni
-
[SQL][CONNECT] SparkConnectClient may drop metadata (auth headers) on retried/reattached RPCs if metadata is a non-list iterableForse già presa @zainmirzaaa l’ha presa 62 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
[CORE] bug report: collision of resource profile idForse già presa @ybapat l’ha presa 87 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
apache/spark#57498 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[BUILD] Drop oro dependencyAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/spark#57209 · 7 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Merge spark PR script hard blocks on JIRAForse già presa @holdenk l’ha presa 1 giorno fa. Aperta
apache/spark#59693 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/spark
Issue simili
-
enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
spotify/scio#6018 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
scylladb/scylla-migrator#417 ·
-
[Docs] Document `spark.databricks.delta.optimize.maxThreads` in Compaction (bin-packing) sectionApertadelta-docs delta-table-maintenance documentation
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
software-mansion/starknet-jvm#641 ·