Forum Discussion
pipeline slower than notebook
- 8 months ago
Hi rgsalido,
Thank you for the update.
The behavior you're experiencing is normal when running a notebook through a pipeline. Pipelines typically start a new Spark session for each run, which adds extra time compared to running the notebook manually. Because your pipeline runs every 5 minutes, session startup is likely causing most of the delay.
Even with a session tag applied, Spark may still start a new session if the previous one isn't active or if the compute resources are busy.
To improve performance, you can try these steps:
Use a consistent session tag in the Notebook activity so Fabric can reuse the Spark session when possible.
Enable high-concurrency or session sharing for pipeline notebooks, if your workspace supports it. This helps the pipeline connect to an existing Spark application instead of starting a new one.
Check your Spark pool capacity. If other jobs are using the pool, session startup may be slower because executors aren't available right away.
Review the Spark UI timeline for idle periods, which often show Spark waiting for resources, shuffle, or I/O, rather than issues in your code.
If your pipeline needs to run frequently, consider keeping a warm session active with the same tag so notebook runs can attach to it faster.
Thank you.
Hi Ugk161610 ,
I agree spark session start time is where we are seeing idle in the image at the begining of the job, but I'm little confused on these
at 12:13:00 job started running and again from 12:14:00 to 12:14:40 it shows idle. Any idea why its been idle?
Regards,
Srisakthi
- Ugk1616108 months agoSuper User
Hi Srisakthi ,
That idle period usually means Spark was waiting (for executors, shuffle, I/O, or a short blocking operation) — not that your code was wrong. Check the Spark UI stage timeline and executor allocation around 12:14 to see which of the above matches your run, then apply the small fixes above.
If you want, paste the exact stage timeline or a screenshot of the Spark UI for 12:13–12:15 and I’ll point to the most likely cause.
– Gopi Krishna