Skip to main content
InterviewHubPRO
Section Overview
Q46

Question 46 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

92%
Apache Spark Big Data (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

Spark Executor Sizing Rules of Thumb: Cores, Memory, and Overhead.

senior Levelapache-sparkAdvanced Internals

In Simple Words: Production best-practice executor sizing formulas:

  1. Cores per Executor: Keep between 4 and 5 cores (spark.executor.cores = 5).
    • $> 5$ cores leads to JVM Garbage Collection thrashing.
    • 1 core per executor wastes shared broadcast memory.
  2. Executor Overhead Memory (spark.executor.memoryOverhead):
    • Calculated as max(384MB, 10% of executor.memory).
    • Allocate 15-20% if using heavy PySpark Arrow operations or off-heap shuffles.
  3. Leave 1 Core and 1GB RAM per Node for OS kernel and container runtime daemons.