question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

faq.rst provides incorrect instructions for reducing scheduling latency

See original GitHub issue

Regarding the FAQ note “How to reduce airflow dag scheduling latency in production” - Per https://github.com/apache/airflow/blame/f097ae39a7243bd25d4d26664bc259981b2ba217/docs/faq.rst#L209:

User should consider to increase scheduler_heartbeat_sec config to a higher value (e.g 60 secs) which controls how frequent the airflow scheduler gets the heartbeat and updates the job’s entry in database.

However, since scheduler_heartbeat_sec is used as a duration (not as heartbeats/sec rate) in airflow/jobs/scheduler_job.py, increasing it to 60 (from the default 5 sec) would actually cause scheduling to become more sluggish, thus increasing latency.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ashbcommented, Nov 14, 2020

Yes. The task lag was fixed by AIP-15 and in my tests the delay between tasks is down to 0.18s

Try out 2.0.0beta2?

1reaction
vitaly-kruglcommented, Nov 13, 2020

Hi @ashb - The reason I was looking at scheduler_heartbeat_sec is that I am trying to improve the performance of system-level tests in my airflow-based app.

What I am seeing is that even under very low utilization, Airflow adds latency of 4-5 seconds for executing each task. I was looking at airflow.cfg options to tune to eliminate this 4-5 second per task latency on my testing setup. I haven’t been able to find any combination of options that would reduce the latency below 4-5 seconds.

Any suggestions about how to eliminate these Airflow latencies for my testbed?

My test setup: one DAG with two tasks: Task A and Task B, with A >> B relationship. Implementation is in python. Each one of the python callbacks does minimum (almost no-op) work that shows up in the logs at < 1 sec. However, each dagrun takes upwards of 9 seconds and I observe from the timestamps (dagrun, Task A start/end and Task B start/end) that there are 3-5 second gaps between dagrun and Task A start, as well as between Task A end and Task B start.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FAQ — Airflow Documentation
Why is task not getting scheduled? How to improve DAG performance? How to reduce DAG scheduling latency / task delay? How do I...
Read more >
Optimizing RHEL 8 for Real Time for low latency operation
Changing process scheduling policies and priorities using the tuna CLI ... The vendor documentation can provide instructions to reduce or remove any System ......
Read more >
Trade Reporting Frequently Asked Questions | FINRA.org
The guidance provided in this FAQ pertains to the reporting of over-the-counter (OTC) transactions in equity securities to a FINRA Facility (a Trade ......
Read more >
GAO-16-89G, Schedule Assessment Guide
The GAO Schedule Assessment Guide also presents guiding principles for auditors to evaluate certain aspects of government programs.
Read more >
Amazon CloudWatch FAQs - Amazon Web Services (AWS)
Amazon CloudWatch receives and provides metrics for all Amazon EC2 instances ... by cross-account monitoring helps you reduce the manual effort required to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found