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. -
AnmolGan81 - Are you specifically running the two queries in two different notebooks? Have you tried putting them in the same notebook and then running the notebook so that both queries are executed? The query you posted is very basic - you shouldn't need to change the capacity settings or scale up to a higher capacity. Since you are just querying the first 1000 rows of data from a lakehouse table, you don't really need ot use spark - you can just use Python. See the snip below. Can you please reply with screenshots showing the language and language version being used? Also please let us know what the Spark settings are - these appear in the workspace settings under Data Engineering. Thanks!
No I am talking about running 2 queries in different notebook and not same notebook, yes I can very well run in the same notebook but I was trying to see what happens if I run two queries in different notebooks when 1 notebook query session is already active, and I have not changed the capacity setting and all this I am doing in on F2.
Well I found another blog which has faced the similar issue:
Re: Spark Sessions in MS Fabric Fail to Connect - Microsoft Fabric Community