Home / Databricks on Azure

Databricks on AzureTroubleshootingAdvanced

Azure Databricks jobs slow or failing on ADLS 503 Server Busy: storage account throttling, ABFS retries and spreading the load

When many clusters hit one ADLS account, Azure returns 503 and 500 responses, the ABFS driver backs off, and Spark tasks stall. Prove it with metrics and logs, then cut requests and spread the load.

Deepak Bhardwaj6 min read

Applies toAzure Databricks classic and serverless compute, ADLS Gen2 (StorageV2 with hierarchical namespace), ABFS driver in Databricks Runtime 13.3 LTS and later

Symptom

Jobs that used to finish on time now run 2-5x longer, with no code change. The Spark UI shows tasks in scan or write stages with large gaps and uneven durations. Executor logs (stderr / log4j) contain AbfsRestOperationException with HTTP 503 ("The server is busy") or HTTP 500 ("Operation could not be completed within the specified time"). Sometimes a task fails once the retries run out, and the stage retries.

This usually starts when a new workload lands on a storage account that other jobs already share. Typical examples are a backfill, a new Auto Loader stream in directory-listing mode, a VACUUM on a large table, or a BI tool fanning out queries.

The ABFS driver behind abfss:// retries throttled requests with exponential backoff. Its client-side throttling (fs.azure.enable.autothrottling, on by default) also slows down requests before they are sent. Both of these work as designed. They are also why throttling shows up as slowness first and as failures only later.

Checks

1. Confirm the storage account is returning throttling responses

Split the Transactions metric by ResponseType. ServerBusyError (503) and ServerTimeoutError (500) are the server-side signals. ClientAccountRequestThrottlingError and ClientAccountBandwidthThrottlingError mean you are over the account's request-rate or bandwidth limit.

SA_ID=$(az storage account show -n stlakeprod -g rg-lake --query id -o tsv)

az monitor metrics list --resource "$SA_ID" \
  --metric Transactions --dimension ResponseType \
  --interval PT5M --aggregation Total \
  --start-time 2026-11-16T00:00:00Z --end-time 2026-11-16T12:00:00Z \
  -o table

Check bandwidth over the same window:

az monitor metrics list --resource "$SA_ID" \
  --metric Ingress Egress --interval PT5M --aggregation Total -o table

Compare the peaks with the account's scalability targets: request rate, ingress and egress per account, which differ by region. Look up the current limits for your region rather than guessing.

2. Find who is generating the load

This needs diagnostic settings that send StorageRead, StorageWrite and StorageDelete from the blob service to Log Analytics.

StorageBlobLogs
| where TimeGenerated > ago(6h)
| where AccountName == "stlakeprod"
| summarize total = count(),
            throttled = countif(StatusCode in ("503", "500")),
            p95_server_ms = percentile(ServerLatencyMs, 95)
    by bin(TimeGenerated, 5m), CallerIpAddress
| order by throttled desc

Use the busiest windows to see which operations dominate:

StorageBlobLogs
| where TimeGenerated > ago(6h) and AccountName == "stlakeprod"
| summarize ops = count() by OperationName, StatusCode
| top 20 by ops

What the result usually tells you:

  • ListFilesystemDir, ListBlobs or GetPathStatus at the top means listing-heavy work: directory-listing Auto Loader, VACUUM, dbutils.fs.ls loops, or tables with millions of small files.
  • ReadFile or GetBlob dominating with a high egress peak means big parallel scans.
  • AppendFile or FlushFile storms mean many small writes.

With classic VNet-injected compute, CallerIpAddress points to your cluster subnets. Serverless traffic comes from Databricks-managed addresses or private endpoints, so match on time and on UserAgentHeader instead. The exact user agent string varies by runtime.

3. Tie it to Databricks workloads

Map the throttled windows to the jobs that were running:

SELECT t.job_id, j.name, t.run_id, t.period_start_time, t.period_end_time, t.result_state
FROM system.lakeflow.job_run_timeline t
LEFT JOIN system.lakeflow.jobs j
  ON t.job_id = j.job_id AND t.workspace_id = j.workspace_id
WHERE t.period_start_time < '2026-11-16T09:00:00'
  AND t.period_end_time   > '2026-11-16T07:00:00'
ORDER BY t.period_start_time;

system.lakeflow.jobs keeps one row per job version, so you may see duplicates. Take the latest change_time if you need a clean list.

Cause and fix map

What you see Likely cause Fix
Listing operations dominate, request rate near the limit Directory-listing Auto Loader, VACUUM on huge tables, small files Switch Auto Loader to file notification or managed file events, compact with OPTIMIZE, schedule VACUUM off-peak
Egress near the account limit during a backfill Many clusters scanning the same account at once Stagger the backfill, cap concurrency, or ask Azure Support for higher ingress/egress limits
Throttling only while one job runs One job with very high task parallelism Lower maxFilesPerTrigger/maxBytesPerTrigger, or reduce workers for that job
Every team's tables in one account No load isolation Split catalogs or schemas onto separate storage accounts (managed storage locations per catalog)
Small AppendFile storms Streaming writes with tiny micro-batches Longer trigger intervals, optimized writes, auto compaction
500 timeouts, low request rate Very large single requests or network path issues Check private endpoint and NAT throughput, and test from a single node

Reduce requests first

Throttling is a request-volume problem, so the lasting fixes all cut requests:

-- Fewer, larger files mean fewer GET/LIST calls for every reader
OPTIMIZE prod.sales.orders;

-- Fewer, larger files at write time
ALTER TABLE prod.sales.orders SET TBLPROPERTIES (
  'delta.autoOptimize.optimizeWrite' = 'true',
  'delta.autoOptimize.autoCompact'   = 'true'
);
# Auto Loader: stop listing the whole directory tree on every batch
(spark.readStream.format("cloudFiles")
   .option("cloudFiles.format", "json")
   .option("cloudFiles.useNotifications", "true")   # needs Event Grid/queue permissions
   .option("cloudFiles.maxFilesPerTrigger", 2000)
   .load("abfss://landing@stlakeprod.dfs.core.windows.net/events/"))

Spread the load

Give heavy domains their own storage accounts. In Unity Catalog, set a managed location per catalog so that new managed tables land in separate accounts:

CREATE CATALOG finance
MANAGED LOCATION 'abfss://finance@stfinanceprod.dfs.core.windows.net/managed';

Moving existing tables is a separate project. Plan it as a migration, not a quick fix.

Retry tuning is a bandage, not a fix

You can raise ABFS retry settings so that long throttling episodes don't fail tasks. On classic clusters, add them to the cluster Spark config with the spark.hadoop. prefix:

spark.hadoop.fs.azure.io.retry.max.retries 30
spark.hadoop.fs.azure.io.retry.max.backoff.interval 60000

Defaults vary by Hadoop/ABFS version, so check what your runtime uses before you change them. Serverless compute does not accept these settings.

Warning

Higher retries keep tasks alive longer, but they do not add capacity. On a shared account, they can make the overload last longer for every other workload. Pair any retry change with a request-reduction fix.

Caution

Do not disable fs.azure.enable.autothrottling to "go faster". Without client-side throttling, more requests reach the account, the 503 rate rises, and every caller backs off harder.

Prevent it next time

  • Alert on Transactions where ResponseType is ServerBusyError, ClientAccountRequestThrottlingError or ClientAccountBandwidthThrottlingError, per storage account.
  • Track the file count per table from DESCRIBE DETAIL (numFiles), and compact tables whose average file size falls well below the target.
  • Load-test large backfills on a non-shared account, or throttle them deliberately with maxBytesPerTrigger and fewer workers.
  • Keep a storage-account-per-domain layout in the lakehouse design so that one team's backfill can't starve everyone's SLAs.
  • Before a planned spike, such as a migration or a historical reload, ask Azure Support for higher ingress/egress limits if you need them.