Forum Discussion
How many sessions I could run in F2 Capacity?
- 1 year ago
Hi AnmolGan81 ,
Thanks for the detailed update and for sharing what you’ve observed, it’s great that you’ve figured out what’s happening with the sessions.
The issue seems to be:
On an F2 SKU, the limited resources (4 Spark vCores) mean you can only run one Spark session at a time, regardless of how many notebooks you’re using. So, if there’s an active session in one notebook, trying to start another session in a different notebook results in the "too many requests" error.
You’re also right that just closing the notebook or stopping the job from the Monitor doesn’t fully terminate the session unless it times out or you explicitly stop it.
A Few Suggestions:
-
Ensure the Session is Stopped:
-Adding spark.stop() to the end of your notebook is the reliable way to free up resources.
-Restarting the capacity works, but that’s more of a workaround than a long-term fix. -
Enable Bursting (with Limitations):
-Bursting temporarily increases the available Spark vCores for your capacity (e.g., an F2 SKU can scale up to 20 Spark vCores during bursts).
-This allows for better concurrency, meaning you may be able to run multiple notebooks simultaneously during a burst period, provided the combined workload does not exceed the burst limit.
-However, bursting is not a permanent solution and can only support short-term spikes in usage. If both jobs are resource-intensive, you might still run into resource contention even with bursting enabled.
-Bursting depends on resource availability, and it's important to note that it only helps with concurrency but doesn't guarantee success for all parallel workloads. -
Upgrade Your Capacity:
-If running multiple sessions in parallel is essential, upgrading to an F4 SKU or higher would provide more Spark vCores and better concurrency support.
Let me know if you need help managing sessions, enabling bursting, or exploring capacity options. Happy to assist further!
If this helps, please accept as solution to help others benefit, a kudos would be appreciated.
Best regards,
Vinay. -
Hello AnmolGan81 - thanks for posting.
Yes, there are limits on the number of sessions that can be created based on the capacity SKU - due to the compute resources for the capacity. Concurrency limits are based on the number of Spark VCores for the capacity - each capacity unit (CU) provides 2 Spark VCores. The F2 capacity has 2 capacity units and therefore 4 Spark VCores. You can run multiple sessions, but the exact number will depend on the capacity resource available and the requirements of each session. If the capacity is temporarily fully utilized then additional sessions will be pended until capacity resources are available - if the capacity is fully utilized for a prolonged period of time then the sessions could be throttled or rejected. This can be monitored using the Capacity Monitoring Report.
Here are some links to documentation where you can read more.
Concurrency limits and queueing in Apache Spark for Fabric - Microsoft Fabric | Microsoft Learn
Install the Microsoft Fabric capacity metrics app - Microsoft Fabric | Microsoft Learn
Please let me know if there are any other questions I can answer.
So I have been running basic query for a delta table that is already created, below query I am running in notebook
- govindarajan_d1 year agoSuper User
Hi AnmolGan81 ,
It is strange that the query keeps running after it finishes. Ideally, you shouldn't have to do this, but try adding the below code in your notebook at the end to see if that terminates the notebook.
spark.stop()You can also try using a high concurrency session for your notebooks if queries are split across different notebooks, so that you do not face the capacity exceeded issue.
- AnmolGan811 year agoAdvocate II
okay let me try it