cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
Machine Learning
cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Keep long-running notebook alive when closing browser

orion216
New Contributor II

I am working with Azure Databricks jupyter notebooks and have time-consuming jobs (complex queries, model training, loops over many items, etc.).

Every time I close the browser (or step away for a long time) of some running notebook, even before the cluster time-out time, notebooks and cluster will become idle. When I open the notebook again, it appears as if it the notebook resumes, but it does not continue executing. I'd like to keep the notebook running in the background at night or when I close the browser. Any thoughts ?

1 ACCEPTED SOLUTION

Accepted Solutions

Atanu
Esteemed Contributor
Esteemed Contributor

I think you should try increasing the inactivity time and if the issue still persists. This should not happen actually @Eric Pā€‹ 

View solution in original post

6 REPLIES 6

Aashita
Contributor III
Contributor III

@Eric Pā€‹ , To keep the cluster active at all times,

  • Disable "Automatic termination"
  • create a notebook with simple print
  • "%sql select 1" commands and schedule it to run at regular intervals(avoid scheduling forever) to keep the cluster active all the time.
  •  

 Also, checkout this doc- https://docs.databricks.com/clusters/clusters-manage.html?&_ga=2.26996221.1323833801.1652117370-1078...

Kaniz
Community Manager
Community Manager

Hi @Eric Pā€‹  , Just a friendly follow-up. Do you still need help, or @Aashita Ramtekeā€‹ 's response help you to find the solution? Please let us know.

orion216
New Contributor II

Hi @Kaniz Fatmaā€‹ @Aashita Ramtekeā€‹ 

  1. There is no "Automatic termination". Are you talking about "Terminate after"

image.png2. I look for a more sustainable solution. Your solution requires running secondary script that continuously pings the server and never stops, which translate to cost. I look for something that does not kill the job half-way and keep it alive until completion. It's a simple capability that every platform support.

Does it mean we can never run a time-consuming job or train a model without sitting there looking at the screen overnight ?

Thank you.

Kenny.

Atanu
Esteemed Contributor
Esteemed Contributor

I think you should try increasing the inactivity time and if the issue still persists. This should not happen actually @Eric Pā€‹ 

Prabakar
Esteemed Contributor III
Esteemed Contributor III

@Eric Pā€‹ If you want the notebook to be running, why not create and schedule a job for the notebook?

https://docs.microsoft.com/en-us/azure/databricks/data-engineering/jobs/jobs#--create-a-job

Anonymous
Not applicable

Hey @Eric Pā€‹ 

Just wanted to check in if you were able to resolve your issue. If yes, would you be happy to mark an answer as best? If not, please tell us so we can help you.

Thanks!

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.