cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to find the billing of each cell in a notebook?

jyunnko
New Contributor

Suppose I have run ten different statements/tasks/cells in a notebook, and I want to know how many DBUs each of these ten tasks used. Is this possible?

1 REPLY 1

Isi
New Contributor II

Hey,

I really think this itโ€™s not possible to directly determine the cost of a single cell in Databricks.


However, you can approach this in two ways, depending on the type of cluster youโ€™re using, as different cluster types have different pricing models:

Using the cluster cost:

For all-purpose (interactive) clusters, Databricks charges per DBU/hour based on the instance type and autoscaling settings. You can estimate the cost by looking at how long the cluster was running while the cell was being executed and then calculating the cost based on the DBU rate. 

For job clusters, costs are usually lower since youโ€™re only charged for the duration of the job. If youโ€™re using this type of cluster, you can break down the total cost based on the runtime of the job that includes the cell.

For serverless clusters, the cost is based on dynamically allocated resources, making it a bit trickier to estimate costs accurately. In this case, checking execution logs and usage metrics could help provide better insights.

Pricing calculator

Running the notebook as a job with System Tables enabled:

If you run your notebook as a job and have System Tables enabled, you can query the system.jobs_run_cost table to get the total cost of the job.

If you find this answer helpful, feel free to mark it as resolved or give it a ๐Ÿ‘!

๐Ÿ™‚

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group