<?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 Re: Speeding up Command Execution API in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/speeding-up-command-execution-api/m-p/106816#M42601</link>
    <description>&lt;P&gt;My first thought concurs with&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/106294"&gt;@Alberto_Umana&lt;/a&gt;,&amp;nbsp;the only time I've seen queuing like that is when the cluster is not running.&amp;nbsp; Make sure you have the correct warehouse_id configured in your API calls.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jan 2025 14:46:41 GMT</pubDate>
    <dc:creator>Rjdudley</dc:creator>
    <dc:date>2025-01-23T14:46:41Z</dc:date>
    <item>
      <title>Speeding up Command Execution API</title>
      <link>https://community.databricks.com/t5/data-engineering/speeding-up-command-execution-api/m-p/106807#M42596</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm using the Databricks Command Execution api to run some spark computations on a dedicated cluster and return the results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would ideally want the results quickly, especially since the spark computations needed take less that 0.1s.&lt;/P&gt;&lt;P&gt;However when running the command, the status is "Queued" for 5-10s, even though the cluster is not used for anything else.&lt;/P&gt;&lt;P&gt;Is there any way to speed up the command execution ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erigaud_0-1737640182808.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/14300i014AF17E5A7E10B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erigaud_0-1737640182808.png" alt="erigaud_0-1737640182808.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 13:50:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/speeding-up-command-execution-api/m-p/106807#M42596</guid>
      <dc:creator>erigaud</dc:creator>
      <dc:date>2025-01-23T13:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Speeding up Command Execution API</title>
      <link>https://community.databricks.com/t5/data-engineering/speeding-up-command-execution-api/m-p/106809#M42597</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/84270"&gt;@erigaud&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Before running the commands, how have you validated nothing is running / cluster is not in use?&lt;/P&gt;
&lt;P&gt;A few suggestions:&lt;/P&gt;
&lt;P class="p1"&gt;Make sure that the cluster is in a running state before you submit the command. The CommandExecutionAPI has a method to ensure the cluster is running&lt;/P&gt;
&lt;P class="p1"&gt;Creating a new execution context for each command can add overhead. Instead, create an execution context once and reuse it for multiple commands. This can be done by creating an execution context and then using it for subsequent commands&lt;/P&gt;
&lt;P class="p1"&gt;// Create an execution context&lt;/P&gt;
&lt;P class="p1"&gt;Created context = commandExecutionService.create(new CreateContext(clusterID, language));&lt;/P&gt;
&lt;P class="p1"&gt;String contextId = context.getId();&lt;/P&gt;
&lt;P class="p1"&gt;// Execute commands using the created context&lt;/P&gt;
&lt;P class="p1"&gt;Command command = new Command(clusterID, contextId, language, commandStr);&lt;/P&gt;
&lt;P class="p1"&gt;Created commandResponse = commandExecutionService.execute(command);&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 13:59:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/speeding-up-command-execution-api/m-p/106809#M42597</guid>
      <dc:creator>Alberto_Umana</dc:creator>
      <dc:date>2025-01-23T13:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Speeding up Command Execution API</title>
      <link>https://community.databricks.com/t5/data-engineering/speeding-up-command-execution-api/m-p/106816#M42601</link>
      <description>&lt;P&gt;My first thought concurs with&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/106294"&gt;@Alberto_Umana&lt;/a&gt;,&amp;nbsp;the only time I've seen queuing like that is when the cluster is not running.&amp;nbsp; Make sure you have the correct warehouse_id configured in your API calls.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 14:46:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/speeding-up-command-execution-api/m-p/106816#M42601</guid>
      <dc:creator>Rjdudley</dc:creator>
      <dc:date>2025-01-23T14:46:41Z</dc:date>
    </item>
  </channel>
</rss>

