Forum Discussion
Optimizing CU Usage in Microsoft Fabric
- 1 year ago
Hi CReportify
Yes, it is possible to reduce the driver cores when executing a notebook in Microsoft Fabric. You can configure the driver cores using the `%%configure` magic command at the beginning of your notebook. Here’s an example:
%%configure -f
{
"driverMemory": "56g",
"driverCores": 32,
"executorMemory": "28g",
"executorCores": 4
}Microsoft Fabric does not currently offer a built-in way to manually trigger or schedule specific background tasks like metadata processing during off-peak hours. The platform automatically manages certain background processes, and there’s no direct control over when these tasks execute after capacity is resumed.
Microsoft Fabric supports autoscaling for Spark pools. When you set up a Spark pool, you can enable autoscaling by configuring a range for the number of nodes. The system will automatically add or remove nodes based on workload demand.
I have tried to answer all your queries here.
please accept this as solution if this resolved your query.
thanks
Hi CReportify
Please try these options:
Reduce Driver Cores
Your notebooks are currently using 8 driver cores, which may be excessive for the amount of data processed. Try reducing the number of cores to 4 or even 2, as this can significantly lower CU consumption without necessarily impacting performance for your data volumes.
Consider Pipelines
For repetitive API data fetching, pipelines might be more efficient than notebooks. Pipelines can:
• Better handle scheduling
• Provide built-in error handling and logging
• Potentially reduce overall CU usage
Storage: Lakehouse vs. Warehouse
For your current data volumes, a Lakehouse is likely more cost-effective than a Warehouse. Lakehouses are optimized for:
• Handling diverse data types
• Frequent small-scale reads/writes
• Machine learning workloads
However, if you anticipate significant growth in data volume or require complex SQL analytics, a Warehouse might become more suitable in the future
Capacity Management
The massive CU usage spikes after resuming capacity are likely due to the “smoothing” mechanism in Fabric. When you pause capacity, Fabric immediately charges for all scheduled background operations instead of spreading the cost over 24 hours. To mitigate this:
• Schedule pauses during naturally low-usage periods
• Implement autoscaling for more dynamic workloads
Additional Optimization Strategies
1. Batch Processing: Implement batching in your API calls to reduce the number of individual requests, potentially lowering CU usage.
2. Data Partitioning: Properly partition your Lakehouse data based on common query patterns to improve read performance.
3. Caching: Utilize Spark caching for frequently accessed datasets to reduce computation overhead.
4. Monitor and Analyze: Regularly use the Fabric Capacity Metrics app to identify high-consumption operations and optimize accordingly
Hope this helps.
please give kudos and mark this as solution if it resolves your query.
thanks
Hi nilendraFabric,
Thanks for your response, its great!
Is there an option to reduce the driver cores when executing a notebook? Also, how to implement autoscalling for more dynamic load, do you have an example? Lastly, Is there a way to manually trigger or schedule specific background tasks (like metadata processing) to run during off-peak hours, so they don’t immediately execute after capacity is resumed?
Thanks in advance!
- nilendraFabric1 year ago
Super User
Hi CReportify
Yes, it is possible to reduce the driver cores when executing a notebook in Microsoft Fabric. You can configure the driver cores using the `%%configure` magic command at the beginning of your notebook. Here’s an example:
%%configure -f
{
"driverMemory": "56g",
"driverCores": 32,
"executorMemory": "28g",
"executorCores": 4
}Microsoft Fabric does not currently offer a built-in way to manually trigger or schedule specific background tasks like metadata processing during off-peak hours. The platform automatically manages certain background processes, and there’s no direct control over when these tasks execute after capacity is resumed.
Microsoft Fabric supports autoscaling for Spark pools. When you set up a Spark pool, you can enable autoscaling by configuring a range for the number of nodes. The system will automatically add or remove nodes based on workload demand.
I have tried to answer all your queries here.
please accept this as solution if this resolved your query.
thanks