BigQuery Admin reference guide: Jobs & reservation modelBigQuery Admin reference guide: Jobs & reservation modelDeveloper Advocate

How do I control the number of slots?

If you use on-demand pricing, where you pay for the number of bytes processed by queries, then you’ll get access to 2,000 slots in each project. With flat-rate pricing you can purchase a dedicated number of slots by buying a capacity commitment. Commitments purchase a specified number of slots, over some duration of time, in a certain location. This can either be an annual commitment, monthly commitment or a flex commitment. Flex commitments are only 60 seconds, meaning you can cancel any time after 60 seconds. While longer term commitments offer reduced per-slot pricing, shorter term commitments can be useful to handle seasonality in your workloads (e.g. everyone is analyzing your retail transactions data after Black Friday) or test out queries with access to specific slots. 

The BigQuery reservation model

Once you have your slots, you can go one step further and create a reservation. This is essentially a bucket of slots that can be allocated in ways that make sense for your organization. With a reservation in place, you can create an assignment that delegates the slots to specific projects, folders, or the entire organization. For example, we might create a reservation to be used for data science (ds) workloads, and then assign the data science folder (containing ds_project_a, ds_project_b and ds_project_c) to it. One great thing about BigQuery is that it automatically shares idle slots, so if no one is running queries in the ds folder, workloads from elt or dashboard projects can use them instead.

Leave a Comment