<?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: Why is the default auto-termination for serverless interactive notebook compute 60 minutes? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/why-is-the-default-auto-termination-for-serverless-interactive/m-p/165419#M55436</link>
    <description>&lt;P&gt;Confirmed with an actual serverless session left idle until it hit the timeout on its own:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elizeu_reis_0-1786498404935.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/29916i60D499AD732A820A/image-size/large?v=v2&amp;amp;px=999" role="button" title="elizeu_reis_0-1786498404935.png" alt="elizeu_reis_0-1786498404935.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This INACTIVITY termination only happened because I closed the notebook and reopened it more than an hour later. When I left the notebook open (tab still active, no cells running) for over an hour, the serverless cluster did not auto-terminate after the 60-minute idle window. So the idle timeout appears to only kick in reliably when the notebook itself is closed/disconnected, not simply when there's no command execution while the notebook stays open.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Aug 2026 01:52:20 GMT</pubDate>
    <dc:creator>elizeu_reis</dc:creator>
    <dc:date>2026-08-12T01:52:20Z</dc:date>
    <item>
      <title>Why is the default auto-termination for serverless interactive notebook compute 60 minutes?</title>
      <link>https://community.databricks.com/t5/data-engineering/why-is-the-default-auto-termination-for-serverless-interactive/m-p/165406#M55435</link>
      <description>&lt;P class=""&gt;We've been digging into serverless interactive compute costs in notebooks, because our internal cost monitoring (cross-referencing &lt;STRONG&gt;system.billing.usage&lt;/STRONG&gt; with &lt;STRONG&gt;system.query.history&lt;/STRONG&gt;) showed a large share of the spend coming from idle time rather than actual query execution. To understand why, we wanted to inspect the actual cluster configuration behind a serverless notebook session — but the notebook UI doesn't expose a cluster ID anywhere for serverless, so there's no obvious way to query it via API or SDK.&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;STRONG&gt;How we found the serverless cluster ID (not exposed in the UI):&lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;The workaround: open your browser's DevTools → Network tab, attach the notebook to Serverless, and run any cell. This triggers a request to the internal &lt;STRONG&gt;notebook/{notebook_id}/command&lt;/STRONG&gt; endpoint. In that request's headers, look at &lt;STRONG&gt;x-databricks-attribution-tags&lt;/STRONG&gt; — it's a URL-encoded JSON blob, and one of its fields (&lt;STRONG&gt;clusterId&lt;/STRONG&gt;) contains the serverless cluster ID generated for that session. With that ID, you can query the cluster programmatically via the SDK:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elizeu_reis_1-1786480157179.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/29910i6BA8F06A3E82A49D/image-size/large?v=v2&amp;amp;px=999" role="button" title="elizeu_reis_1-1786480157179.png" alt="elizeu_reis_1-1786480157179.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os

from databricks.sdk import WorkspaceClient
from databricks.sdk.service import compute

w = WorkspaceClient()

cluster_id = "your_serverless_cluster_id"

cluster = w.clusters.get(cluster_id)

print(cluster.autotermination_minutes)&lt;/LI-CODE&gt;&lt;P class=""&gt;&lt;STRONG&gt;The actual finding:&lt;/STRONG&gt;&lt;/P&gt;&lt;P class=""&gt;Querying the cluster this way, I see that &lt;STRONG&gt;autotermination_minutes&lt;/STRONG&gt; defaults to &lt;STRONG&gt;60 minutes&lt;/STRONG&gt; — the same value historically used for classic all-purpose clusters, which take several minutes to spin up (which is why it makes sense not to tear down a classic cluster too quickly).&lt;/P&gt;&lt;P class=""&gt;But serverless compute has the opposite value proposition: near-instant startup, with no provisioning cost for the user to wait through. That should allow for a much more aggressive idle timeout — without the "wait for the cluster to come back up" trade-off that justifies 60 minutes on classic clusters.&lt;/P&gt;&lt;P class=""&gt;In practice, this generates real waste: we cross-referenced &lt;STRONG&gt;system.billing.usage&lt;/STRONG&gt; with &lt;STRONG&gt;system.query.history&lt;/STRONG&gt; to measure real usage vs. idle time in developer sessions, and in one specific case we found &lt;STRONG&gt;99.7% of billed time was idle&lt;/STRONG&gt; — a user who ran just over 1 minute of actual commands ended up billed for a 6-hour session, because the notebook was left open without ever hitting "Terminate."&lt;/P&gt;&lt;P class=""&gt;When I query interactive serverless sessions for a user directly against the billing table, I can clearly see several sessions lasting exactly 60 minutes.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elizeu_reis_2-1786480657737.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/29911i1BA034BE9A5EAD7B/image-size/large?v=v2&amp;amp;px=999" role="button" title="elizeu_reis_2-1786480657737.png" alt="elizeu_reis_2-1786480657737.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%sql
-- 'Query generated by genie code'
WITH prices AS (
  SELECT
    sku_name,
    usage_unit,
    price_start_time,
    COALESCE(price_end_time, date_add(current_date, 1)) AS price_end_time_eff,
    pricing.default AS unit_price
  FROM system.billing.list_prices
  WHERE currency_code = 'USD'
)
SELECT
  u.usage_start_time,
  u.usage_end_time,
  ROUND(timestampdiff(SECOND, u.usage_start_time, u.usage_end_time) / 60.0, 2) AS duration_minutes,
  u.sku_name,
  ROUND(u.usage_quantity, 4) AS dbu,
  ROUND(u.usage_quantity * p.unit_price, 4) AS cost_usd,
  u.usage_metadata.notebook_id AS notebook_id,
  u.usage_metadata.notebook_path AS notebook_path
FROM system.billing.usage u
  LEFT JOIN prices p
    ON u.sku_name = p.sku_name
    AND u.usage_unit = p.usage_unit
    AND u.usage_end_time BETWEEN p.price_start_time AND p.price_end_time_eff
WHERE
  u.billing_origin_product = 'INTERACTIVE'
  AND u.identity_metadata.run_as = 'USER_EMAIL'
  AND u.usage_date = '2026-08-10'
  AND u.workspace_id IN ('WORKSPACE_ID_1', 'WORKSPACE_ID_2')
ORDER BY u.usage_start_time&lt;/LI-CODE&gt;&lt;P&gt;So, why is the default auto-termination for serverless interactive notebook compute 60 minutes?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2026 21:02:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/why-is-the-default-auto-termination-for-serverless-interactive/m-p/165406#M55435</guid>
      <dc:creator>elizeu_reis</dc:creator>
      <dc:date>2026-08-11T21:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the default auto-termination for serverless interactive notebook compute 60 minutes?</title>
      <link>https://community.databricks.com/t5/data-engineering/why-is-the-default-auto-termination-for-serverless-interactive/m-p/165419#M55436</link>
      <description>&lt;P&gt;Confirmed with an actual serverless session left idle until it hit the timeout on its own:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="elizeu_reis_0-1786498404935.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/29916i60D499AD732A820A/image-size/large?v=v2&amp;amp;px=999" role="button" title="elizeu_reis_0-1786498404935.png" alt="elizeu_reis_0-1786498404935.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This INACTIVITY termination only happened because I closed the notebook and reopened it more than an hour later. When I left the notebook open (tab still active, no cells running) for over an hour, the serverless cluster did not auto-terminate after the 60-minute idle window. So the idle timeout appears to only kick in reliably when the notebook itself is closed/disconnected, not simply when there's no command execution while the notebook stays open.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2026 01:52:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/why-is-the-default-auto-termination-for-serverless-interactive/m-p/165419#M55436</guid>
      <dc:creator>elizeu_reis</dc:creator>
      <dc:date>2026-08-12T01:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the default auto-termination for serverless interactive notebook compute 60 minutes?</title>
      <link>https://community.databricks.com/t5/data-engineering/why-is-the-default-auto-termination-for-serverless-interactive/m-p/165438#M55437</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/247548"&gt;@elizeu_reis&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can change the Serverless Cluster timeout by going to &lt;STRONG&gt;Settings → Compute&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I’ve attached a screenshot for reference. I hope this helps!&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 12 Aug 2026 07:00:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/why-is-the-default-auto-termination-for-serverless-interactive/m-p/165438#M55437</guid>
      <dc:creator>Niyojit</dc:creator>
      <dc:date>2026-08-12T07:00:00Z</dc:date>
    </item>
  </channel>
</rss>

