Cloud Technology

How to optimize cost and performance for Apache Airflow on Kubernetes?

ME Asked by Melissa Wagner · 20-05-2025
0 upvotes 11,123 views 0 comments
The question

Our Airflow instance on EKS is getting quite expensive due to the high number of worker nodes being spun up for small tasks. Are there specific executor configurations or pod autoscaling strategies you recommend to keep the costs down without increasing latency?

3 answers

0
CY
Answered on 22-05-2025

The biggest win for us was switching to the KubernetesExecutor with specific resource requests and limits for every task. By default, pods might request more CPU/RAM than needed, leading to underutilized nodes. You should also look into using 'Karpenter' instead of the standard Cluster Autoscaler on AWS. Karpenter is much faster at provisioning the right-sized instances (like Spot instances) for your workload. Also, ensure you are using 'Task Groups' and avoiding heavy logic in the DAG parsing code, which can bloat the Scheduler's memory usage.

0
BR
Answered on 23-05-2025

Have you considered using the CeleryKubernetesExecutor to handle small, frequent tasks via Celery workers while offloading the heavy, long-running jobs to K8s pods?

ME 24-05-2025

I hadn't thought about the hybrid approach. Currently, even a simple 'Hello World' python task spins up a whole pod, which seems like massive overkill for our daily reporting runs.

0
GR
Answered on 26-05-2025

Spot instances are your best friend for non-critical ETL. We cut our Airflow compute bill by nearly 60% just by moving the worker node groups to AWS Spot instances.

CY 28-05-2025

Just make sure you have solid retry logic in your DAGs. If a Spot instance is reclaimed, you don't want the whole pipeline to fail without a second attempt.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session