Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E3283200B3C for ; Wed, 13 Jul 2016 20:18:11 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E1B89160A6A; Wed, 13 Jul 2016 18:18:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 11BA8160A62 for ; Wed, 13 Jul 2016 20:18:10 +0200 (CEST) Received: (qmail 8681 invoked by uid 500); 13 Jul 2016 18:18:10 -0000 Mailing-List: contact dev-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list dev@airflow.incubator.apache.org Received: (qmail 8239 invoked by uid 99); 13 Jul 2016 18:18:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2016 18:18:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 5AF031A5DB5 for ; Wed, 13 Jul 2016 18:18:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.279 X-Spam-Level: * X-Spam-Status: No, score=1.279 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=neon-lab-com.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id IOnrgiwTleax for ; Wed, 13 Jul 2016 18:18:06 +0000 (UTC) Received: from mail-oi0-f50.google.com (mail-oi0-f50.google.com [209.85.218.50]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 225225FBD8 for ; Wed, 13 Jul 2016 18:18:06 +0000 (UTC) Received: by mail-oi0-f50.google.com with SMTP id s66so82338033oif.1 for ; Wed, 13 Jul 2016 11:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neon-lab-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=+lCS5N9FjcJDBJBLh/7d6FBMTyxAIt8CJOoG7j0kylI=; b=tYWbW9Uwu9VotCetPwKpRndv0I7wJv3Cen4WPMvjiGK4DptVL3CkeoLn5Viu4ZBKD9 QRwLu9Kmp657HFDG8HbnA2mB7Ho26188CObUOACBghpbW4sSacerKOeyYJ05eMpPutFS C99ihObVUb/oyK6XLVz8yKzrpMN3zPzR1PJTWr6anwjZ9Op1EONxnoq5ddLJKtHIAz7+ Y0GaPB2DUo4MztmmHNmP3Qml7usahWHVlJsQ7R4tp4vYDRU1bjoY4Nmmx/XLDmUf4s+D XQDBXI4g4vNlEH7/5vdrFjmoLa4sdelQG9jUQIT/oqmKK+c8mM4FWflEtCRbhbRe15lA Zi+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=+lCS5N9FjcJDBJBLh/7d6FBMTyxAIt8CJOoG7j0kylI=; b=VuWxBmEPuHdnQNH5Z9pVYOzmU7Uso7XJCKZGqxEvyhrpeaiL7BLckIdd/x61wgZZ1Q c51CzLqN85f5tg3IDUpugFkZMsS47OZvmYVic6VhWkmCj7rUTTL1I7ADpbJGOzuPrf6j KSWSGCuLXupDgc4tMOoxcRiQuxIcmhPaCwMkn7eTwJ+0zei7nQEzZNh53tJRyF9bIfz+ SSc68lxVSoRLHQIoncjFz+yFpe3D8NaqqUQ8UbdkTROFjdNSEUl/czQ18SdVLS9ucwal cz6UvTaHh/JtofS8LXEVkzXXTj4Srf8m9ZtGU4yUtdTkIuHBrpc1yEATG8mFaPpCf4Ql y1bw== X-Gm-Message-State: ALyK8tLvzrey6wzS3EvWAfuIDW+b7Ktpr1KgtASn6upVeapCXPvU90q4dZM8BSIyDFCyADw/I22FijBqjwsUihPN X-Received: by 10.157.33.53 with SMTP id i50mr6187331otb.28.1468433884704; Wed, 13 Jul 2016 11:18:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.83.1 with HTTP; Wed, 13 Jul 2016 11:18:04 -0700 (PDT) In-Reply-To: <6B47BE81-1C57-47BA-A195-0FD3B79CB85F@gmail.com> References: <6B47BE81-1C57-47BA-A195-0FD3B79CB85F@gmail.com> From: Nadeem Ahmed Nazeer Date: Wed, 13 Jul 2016 11:18:04 -0700 Message-ID: Subject: Re: airflow scheduler slowness as tasks increase To: dev@airflow.incubator.apache.org Content-Type: multipart/alternative; boundary=001a113d1a1c13095f05378868d1 archived-at: Wed, 13 Jul 2016 18:18:12 -0000 --001a113d1a1c13095f05378868d1 Content-Type: text/plain; charset=UTF-8 Thanks for the response Bolke. Looking forward to have this slowness with the scheduler fixed in the future airflow releases. I am currently on version 1.7.0, will upgrade to 1.7.1.3 and also try your suggestions. I am using CeleryExecutor. If I don't use num_runs, scheduler would just stop after running some number of tasks and I can't figure out why. The scheduler would only start running after I restart the service manually. The fix to that was to add this parameter. I found the num_tasks parameter used in the upstart script for the scheduler by default and also read in the manual to use this ( https://cwiki.apache.org/confluence/display/AIRFLOW/Common+Pitfalls). Thanks, Nadeem On Wed, Jul 13, 2016 at 8:51 AM, Bolke de Bruin wrote: > Nadeem, > > Unfortunately this slowness is currently a deficit in the scheduler. It > will be addressed > in the future, but obviously we are not there yet. To make it more > manageable you could > use end_date for the dag and create multiple dags for it, keeping the > logic the same but > the dag_id and the start-date / end_date different. If you are on 1.7.1.3 > you will then benefit > from multiprocessing (max_threads for the scheduler). In addition you add > load by hand then. > Not ideal but it will work. > > Also depending the speed of your tasks finishing you could limit the > heartbeat so the scheduler > does not run redundantly while not being able to fire off new tasks. > > In addition why are you using num_runs? I definitely do not recommend > using it with a > LocalExecutor and if you are on 1.7.1.3 I would not use it with Celery > either. > > I hope this helps! > > Bolke > > > Op 13 jul. 2016, om 10:43 heeft Nadeem Ahmed Nazeer > het volgende geschreven: > > > > Hi, > > > > We are using airflow to establish a data pipeline that runs tasks on > > ephemeral amazon emr cluster. The oldest data we have is from 2014-05-26 > > which we have set as the start date with a scheduler interval of 1 day > for > > airflow. > > > > We have an s3 copy task, a map reduce task and a bunch of hive and impala > > load tasks in our DAG all run via PythonOperator. Our expectation is for > > airflow to run each of these tasks for each day from the start date till > > current date. > > > > Just for numbers, the number of dags that got created were approximately > > 800 from start date till current date (2016-07-13). All is well at the > > start of the execution but as it executes more and more tasks, the > > scheduling of tasks starts slowing down. Looks like the scheduler is > > spending lot of time in checking states and other houskeeping tasks. > > > > One scheduler loop is taking almost 240 to 300 seconds due to the huge > > number of tasks. It has been running my dags for over 24 hours now with > > little progress. I am starting the scheduler process with restart for > every > > 5 runs which is the default (airflow scheduler -n 5). > > > > I did play around with different parallelism and config parameters > without > > much help. I am looking for some assistance on making scheduler quickly > and > > effectively schedule the tasks. Please help. > > > > Configs : > > parallelism = 32 > > dag_concurrency = 16 > > max_active_runs_per_dag = 99999 > > celeryd_concurrency = 16 > > scheduler_heartbeat_sec = 5 > > > > Thanks, > > Nadeem > > --001a113d1a1c13095f05378868d1--