Repository navigation
Replies: 2 comments
|
Great questions — this is exactly the use case Can you run multiple DAG Processor replicas?Yes. In Airflow 3, the DAG Processor is a standalone component that can be scaled horizontally. Run as many replicas as you like: # In a Kubernetes deployment, for example:
replicas: 2Does each replica process the same file twice? Is there locking?No double-processing by design when you use Each DAG Processor replica seeds its random shuffle with its own hostname, so the file processing order is different on every host. Over time, each file will be processed by some replica, but no replica is racing another to process the same file at the same instant (by statistical distribution, not hard locking). There is no pessimistic file-level lock — if two replicas happen to parse the same file at the same time, both writes reach the metastore and the last writer wins (idempotent parse). This is safe because parsing is read-only on the filesystem and the resulting DagModel upsert is idempotent. Advice for your specific setupYour configuration looks reasonable. A few tuning notes: 1. Two replicas is the sweet spot for Azure Files latencyAzure Files NFS/SMB shares have higher metadata latency than local NVMe. With thousands of files and 1 replica at 2. Tune
|
| Question | Answer |
|---|---|
| Multiple replicas supported? | ✅ Yes |
| Same file processed twice? | Usually no — random_seeded_by_host distributes naturally |
| Hard locking? | No — last-write-wins is safe (idempotent) |
| Recommended replicas for your setup | 2 |
| Main risk | Memory pressure with 16 parse processes on 16 GiB |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi colleagues, perhaps these questions have been asked before, if yes, my apologies.
Can I maintain two (or more) replicas of DAG processor?
If yes, will both replicas process the same file twice? Do they have some sort of locking mechanism?
Is there any advices on the below setup?
We have been running with 1 replica as we are unsure if two replicas can handle our setup. We also would like to give a faster feedback after dags are put on the filesystem.
My setup is something like:
Config:
dag_processor:
refresh_interval: 600
stale_dag_threshold: 300
min_file_process_interval: 600
dag_file_processor_timeout: 600
parsing_processes: 16
file_parsing_sort_mode: random_seeded_by_host
running on 8vcpu 16gib node
any advice is appreciated
All reactions