azurestream-analyticsstreamingcost-optimization

Azure Stream Analytics cost: you pay for streaming units

Stream Analytics bills per streaming unit-hour, the provisioned capacity that runs your streaming query, whether or not data flows. Right-sizing streaming units to real throughput and stopping idle jobs are the levers. Here is the model.

The C3X Team··4 min read

Quick answer

Azure Stream Analytics bills per streaming unit (SU) hour, the provisioned compute that runs your real-time query, billed while the job runs whether or not events flow. Cost is streaming units times running hours, so right-sizing SUs to real throughput, stopping jobs that do not need to run continuously, and writing efficient queries that need fewer SUs are the levers.

Azure Stream Analytics runs real-time analytics queries over streaming data. It is priced by provisioned streaming units, the compute allocated to your job, billed by the hour while the job runs. So an idle but running job still costs, and the cost is the streaming units you allocate times the hours the job runs.

Streaming units are the bill

A streaming unit represents a blend of compute (CPU and memory) allocated to the job. You provision a number of SUs based on the query's complexity and throughput, and pay per SU-hour while the job runs. More SUs handle more throughput and complex queries but cost proportionally more. A running job bills for its SUs whether events are flowing or not.

What drives the bill

FactorEffect
Streaming units allocatedDirectly sets hourly cost
Running hoursIdle-but-running jobs still bill
Query complexity / throughputDrives SUs needed

Over-provisioning SUs for headroom, and leaving jobs running when they do not need to, are the common wastes. The SUs needed depend on the query and throughput, so an efficient query (well-partitioned, avoiding expensive operations) needs fewer SUs for the same throughput.

Controlling Stream Analytics cost

Right-size streaming units to the real throughput and query complexity (monitor SU utilization and adjust), stop or schedule jobs that do not need to run continuously, write efficient, well-partitioned queries that need fewer SUs, and consider whether a job needs to run in real time at all versus batch processing. Because you pay for provisioned SUs while running, sizing and runtime are the levers, the same provisioned-capacity discipline as Event Hubs throughput units.

FAQ

How is Azure Stream Analytics priced?

Per streaming unit (SU) hour, the provisioned compute that runs your real-time query, billed while the job runs whether or not events flow. Cost is the number of streaming units allocated times the hours the job runs, so SU count and running time determine the bill.

What is a streaming unit in Stream Analytics?

A blended unit of compute (CPU and memory) allocated to a Stream Analytics job. You provision SUs based on query complexity and throughput, and more SUs handle more throughput and complex queries at proportionally higher cost. You pay per SU-hour while the job runs.

How do I reduce Stream Analytics cost?

Right-size streaming units to real throughput and query complexity by monitoring SU utilization, stop or schedule jobs that do not need to run continuously, write efficient well-partitioned queries that need fewer SUs, and consider whether a job needs real-time processing versus batch. Sizing and runtime are the main levers.

Does Stream Analytics charge when no data flows?

Yes, while the job is running. Cost is based on provisioned streaming units billed by the hour whether or not events are flowing, so an idle but running job still incurs its SU cost. Stopping jobs that do not need to run continuously avoids paying for idle streaming capacity.

Why does query complexity affect Stream Analytics cost?

Because more complex queries and higher throughput require more streaming units to process, and you pay per SU-hour. An efficient, well-partitioned query that avoids expensive operations needs fewer SUs for the same throughput, so query optimization reduces the SUs you must provision and therefore the cost.

Does C3X estimate Stream Analytics cost?

C3X prices the Stream Analytics job and its streaming-unit configuration from your Terraform, so the provisioned SU cost appears before deploy. Actual SU needs depend on throughput and query complexity, which you tune from monitoring.

What to do next

Size your streaming job before you deploy. C3X reads your Terraform and prices your resources against a live catalog. Start with the quickstart.

Try C3X on your own Terraform

Free and open source. No API key required. One command to install, one command to estimate.