Architecture Overview
Druid uses separate JVMs for tasks to isolate resources and logs. Each Peon is capable of running only one task at a time, whereas a Middle Manager may have multiple Peons.
Resource Isolation
Each task runs in its own JVM (Peon), preventing resource contention and failures from affecting other tasks
Log Separation
Task logs are isolated per Peon, making debugging and monitoring easier
Task Capacity
A single Middle Manager can manage multiple Peons, each running one task
Clean Termination
When a task completes, its Peon JVM is terminated, freeing all resources
Key Responsibilities
Configuration
For Apache Druid Middle Manager service configuration, see:Running the Middle Manager
HTTP Endpoints
For a list of API endpoints supported by the Middle Manager, see:Middle Manager vs. Peon
Understanding the relationship between Middle Managers and Peons is crucial:- Middle Manager
- Peon
Parent Process
- Runs as a persistent service
- Manages multiple Peon JVMs
- Communicates with the Overlord
- Allocates resources to Peons
- Monitors Peon health
The Middle Manager itself doesn’t execute tasks—it delegates to Peons.
Task Execution Workflow
Resource Management
The Middle Manager is responsible for allocating resources to Peon processes:Task Slots
Configure
druid.worker.capacity to set the maximum number of concurrent Peons (tasks) a Middle Manager can runMemory Allocation
Each Peon gets its own JVM heap, configured via task-specific or global settings
CPU Allocation
Operating system handles CPU scheduling across Peon processes
Disk Space
Middle Manager allocates disk space for each Peon’s working directory
Example Capacity Planning
If you configure a Middle Manager with:
druid.worker.capacity = 4- 64 GB total RAM
- 16 CPU cores
- ~12 GB heap per Peon (leaving headroom for OS and Middle Manager)
- ~4 CPU cores per Peon (assuming concurrent execution)
Alternative: Indexer Service
Architecture Integration
With Overlord
- Receives task assignments
- Reports task capacity and availability
- Sends task status updates and completion notifications
- Subject to blacklisting if tasks fail repeatedly
With Peons
- Spawns Peon JVM processes
- Passes task configuration to Peons
- Monitors Peon health and resource usage
- Collects task logs and metrics
With Deep Storage
- Peons write completed segments to deep storage
- Middle Manager manages temporary disk space for Peons
With Metadata Store
- Peons publish segment metadata upon task completion
- Task status and logs may be persisted
Common Configuration Parameters
Maximum number of tasks (Peons) that can run concurrently on this Middle Manager
IP address of the Middle Manager. Used for task assignment and communication
Version identifier for this worker. Can be used for rolling deployments
JVM options to pass to Peon processes. Configure heap size, GC settings, etc.
Base directory for Peon working directories