<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to deal with Slow Jobs? in Community Articles</title>
    <link>https://community.databricks.com/t5/community-articles/how-to-deal-with-slow-jobs/m-p/71357#M105</link>
    <description>&lt;P&gt;Definitely configure &lt;A href="https://docs.databricks.com/en/workflows/jobs/job-notifications.html#configure-notifications-for-slow-running-or-late-jobs" target="_self"&gt;job timeouts,&lt;/A&gt;&amp;nbsp;and configure&amp;nbsp;&lt;A href="https://docs.databricks.com/en/workflows/jobs/job-notifications.html#add-email-and-system-notifications-for-job-events" target="_self"&gt;notifications.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This will help you to identify slowness due to various factors.&lt;/P&gt;
&lt;P&gt;It is crucial to also investigate and fix the issue causing the slowness.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The first step is to identify the problem. This can be done by &lt;STRONG&gt;comparing the run&lt;/STRONG&gt; times of the same job at different instances.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;The next step is to analyze the details of the job. This can be done by &lt;STRONG&gt;checking the SQL query plan&lt;/STRONG&gt;, the read time, and the cloud storage request duration, etc from the Spark UI.&lt;/LI&gt;
&lt;LI&gt;External factors such as &lt;STRONG&gt;storage&lt;/STRONG&gt; and &lt;STRONG&gt;network&lt;/STRONG&gt; can also affect the job run time.&amp;nbsp;&lt;STRONG&gt;Checking Logs&lt;/STRONG&gt;&amp;nbsp;and some system level commands can give insights if the vm is still up and running.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;While comparing the two runs (good and bad), try answering the following&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Is this an intermittent failure or it degraded after a certain point of time.&lt;/LI&gt;
&lt;LI&gt;If it is slow after a certain time consistently was there a DBR change?&lt;/LI&gt;
&lt;LI&gt;Is the volume of the data the same?&lt;/LI&gt;
&lt;LI&gt;Have the cluster configs changed/updated?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;While comparing the DAGs and sql plan&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Look for the stages that took most time.&lt;/LI&gt;
&lt;LI&gt;Use filters and reduce data size.&lt;/LI&gt;
&lt;LI&gt;Check the joins, metrics.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;In the logs&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You can check for errors, warnings.&lt;/LI&gt;
&lt;LI&gt;Go to the timestamp when the stage was delayed.&lt;/LI&gt;
&lt;LI&gt;Compare it with a run where it took the expected time.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Bonus tip -&amp;nbsp;&lt;SPAN&gt;Enable speculative execution for tasks to re-run slow tasks in parallel.&amp;nbsp;spark.speculation=&lt;SPAN class="hljs-literal"&gt;true&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Keep a look out for my new post for more tuning on a slow task/jobs.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 02 Jun 2024 06:04:10 GMT</pubDate>
    <dc:creator>NandiniN</dc:creator>
    <dc:date>2024-06-02T06:04:10Z</dc:date>
    <item>
      <title>How to deal with Slow Jobs?</title>
      <link>https://community.databricks.com/t5/community-articles/how-to-deal-with-slow-jobs/m-p/71357#M105</link>
      <description>&lt;P&gt;Definitely configure &lt;A href="https://docs.databricks.com/en/workflows/jobs/job-notifications.html#configure-notifications-for-slow-running-or-late-jobs" target="_self"&gt;job timeouts,&lt;/A&gt;&amp;nbsp;and configure&amp;nbsp;&lt;A href="https://docs.databricks.com/en/workflows/jobs/job-notifications.html#add-email-and-system-notifications-for-job-events" target="_self"&gt;notifications.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This will help you to identify slowness due to various factors.&lt;/P&gt;
&lt;P&gt;It is crucial to also investigate and fix the issue causing the slowness.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The first step is to identify the problem. This can be done by &lt;STRONG&gt;comparing the run&lt;/STRONG&gt; times of the same job at different instances.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;The next step is to analyze the details of the job. This can be done by &lt;STRONG&gt;checking the SQL query plan&lt;/STRONG&gt;, the read time, and the cloud storage request duration, etc from the Spark UI.&lt;/LI&gt;
&lt;LI&gt;External factors such as &lt;STRONG&gt;storage&lt;/STRONG&gt; and &lt;STRONG&gt;network&lt;/STRONG&gt; can also affect the job run time.&amp;nbsp;&lt;STRONG&gt;Checking Logs&lt;/STRONG&gt;&amp;nbsp;and some system level commands can give insights if the vm is still up and running.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;While comparing the two runs (good and bad), try answering the following&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Is this an intermittent failure or it degraded after a certain point of time.&lt;/LI&gt;
&lt;LI&gt;If it is slow after a certain time consistently was there a DBR change?&lt;/LI&gt;
&lt;LI&gt;Is the volume of the data the same?&lt;/LI&gt;
&lt;LI&gt;Have the cluster configs changed/updated?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;While comparing the DAGs and sql plan&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Look for the stages that took most time.&lt;/LI&gt;
&lt;LI&gt;Use filters and reduce data size.&lt;/LI&gt;
&lt;LI&gt;Check the joins, metrics.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;In the logs&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You can check for errors, warnings.&lt;/LI&gt;
&lt;LI&gt;Go to the timestamp when the stage was delayed.&lt;/LI&gt;
&lt;LI&gt;Compare it with a run where it took the expected time.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Bonus tip -&amp;nbsp;&lt;SPAN&gt;Enable speculative execution for tasks to re-run slow tasks in parallel.&amp;nbsp;spark.speculation=&lt;SPAN class="hljs-literal"&gt;true&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Keep a look out for my new post for more tuning on a slow task/jobs.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jun 2024 06:04:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/community-articles/how-to-deal-with-slow-jobs/m-p/71357#M105</guid>
      <dc:creator>NandiniN</dc:creator>
      <dc:date>2024-06-02T06:04:10Z</dc:date>
    </item>
  </channel>
</rss>

