Apache Spark Big Data (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
How does Spark handle Dynamic Resource Allocation?
senior Levelapache-sparkAdvanced Internals
In Simple Words: Allows Spark to scale the number of allocated Executors dynamically based on queue workload:
- Spawns additional Executors when tasks are backlogged in the task queue for more than
spark.dynamicAllocation.schedulerBacklogTimeout(1s). - Deallocates and removes idle Executors when tasks finish for more than
executorIdleTimeout(60s). - Requires an external shuffle service to preserve shuffle files when idle executors terminate.