Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
JRomero95
Frequent Visitor

Using Time.sleep or Wait activity

Hello,

 

Currently in one of our pipelines we are consuming an API call that has a hourly fixed limit of calls. I was wondering, if we use multiple time.sleep(1hour) inside a notebook, all the time that is "sleeping" is going to be billed.

 

Thanks and regards.

1 ACCEPTED SOLUTION
govindarajan_d
Super User
Super User

Hi @JRomero95,

 

Are you going to pause your capacity in-between? If not, then there is no extra charges for waiting/sleeping. The capacity irrespective of what you do, is billed at fixed cost at seconds level after the first minute. 

 

You can also scale up/down the capacity during the sleeping time (using LogicApp/REST API to scale) which will help you to save costs. For example, you might be running your capacity at F16 when the pipeline is actually running, but during its waiting time you might want to scale down to F2. 

View solution in original post

3 REPLIES 3
govindarajan_d
Super User
Super User

Hi @JRomero95,

 

Are you going to pause your capacity in-between? If not, then there is no extra charges for waiting/sleeping. The capacity irrespective of what you do, is billed at fixed cost at seconds level after the first minute. 

 

You can also scale up/down the capacity during the sleeping time (using LogicApp/REST API to scale) which will help you to save costs. For example, you might be running your capacity at F16 when the pipeline is actually running, but during its waiting time you might want to scale down to F2. 

hello @govindarajan_d,

 

I have accepted your previous answer, but I want to ask you something more, Just to make sure that is clear.

 

from now on use this link as reference: Understand your Fabric capacity Azure bill - Microsoft Fabric | Microsoft Learn

If I go to Azure Portal --> CostManagement --> CostAnalysis, Then search cost related to fabric capacity. Here we can inspect what Microsoft is going to charge and his details.

 

The concept "Compute Pool Capacity Usage CU" as I understant it, is the price of having the capacity online. but, what about "Spark Memory Optimized Capacity Usage CU". Let's say that I use a time.sleep(<weird high number>), that means that the sesion is going to be up and running( but doing nothing). Is this going to increase the billable amount for the concept "Spark Memory Optimized Capacity Usage CU" or it doesen't matter how much time a notebook is running?

 

Again

 

Thanks and regards.

Hi @JRomero95,

 

You would not be paying anything for compute other than what you pay for the time you run your Fabric capacity. So it does not matter how much time your notebook is running. But do note that, a part of the capacity compute is allocated for the running spark session even if it is idle. Which means let's say your spark session is occupying 40% of your compute, then you have 60% for the rest of the other activities running on the capacity. 

 

The split-up that you see in your bill, it will help you to understand where most of the CUs are spent. For example, you might have notebooks, pipelines, eventstream. Over a month, you can easily see which components consumes most of the CUs (this is also possible through Microsoft Fabric Capacity Metrics App). 

 

Other than compute, you would be seeing OneLake storage costs and networking costs. 

 

You can also see this reddit discussion, which has a similar question: https://www.reddit.com/r/MicrosoftFabric/comments/1gu3q0e/extra_costs_in_microsoft_fabric/

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

JanFabricDE_carousel

Fabric Monthly Update - January 2025

Explore the power of Python Notebooks in Fabric!

JanFabricDW_carousel

Fabric Monthly Update - January 2025

Unlock the latest Fabric Data Warehouse upgrades!

JanFabricDF_carousel

Fabric Monthly Update - January 2025

Take your data replication to the next level with Fabric's latest updates!