rajarajangs commented on PR #13595:
URL: https://github.com/apache/gluten/pull/13595#issuecomment-7002577954

   One important scalability concern to consider around **native/off-heap 
memory consumption**:
   
   Validate native memory consumption under concurrent writes
   
   The combined off-heap memory footprint across three distinct layers could 
become a bottleneck under load:
   1. **Velox off-heap allocations** generating native columnar batches.
   2. **In-flight Arrow batches** buffered in the queue (`QueueCapacity = 4`).
   3. **Lance's native Rust encoder buffers**, which (as noted in the 
description) are unmanaged by Spark's `TaskMemoryManager`.
   
   With multiple concurrent write tasks per executor and wide vector columns 
(e.g., 1536/3072-dimensional embeddings), peak native memory consumption could 
grow significantly beyond the budget anticipated by Spark. On containerized 
platforms (Kubernetes / YARN), this risks unexpected executor pod evictions or 
OS OOM kills (Exit Code 137).
   
   Could we:
   1. **Validate peak native memory consumption** under concurrent large-vector 
writes and clarify how Lance's encoder memory is bounded or released under 
memory pressure?
   2. **Make the writer queue capacity configurable**: Expose `QueueCapacity` 
in `VeloxLanceConfig` (e.g., 
`spark.gluten.sql.columnar.backend.velox.lance.writerQueueCapacity`, defaulting 
to `4`) so that memory-constrained environments or high-concurrency executors 
can tune queue depth.
   3. **Provide memory sizing guidance**: Add a note in `VeloxLance.md` 
advising users to sufficiently size `spark.executor.memoryOverhead` / 
`spark.executor.memoryOverheadFactor` when enabling native Lance writes for 
high-volume or vector-heavy workloads.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to