Some data analysis workflows require long-running tasks. This page explains what happens to your session if you run code that takes a long time to execute.
When you run code on DataCamp Workspace, you run this code in an isolated environment on one of DataCamp-managed cloud servers, called a 'session'. When you are no longer working in your workspace for a while, your session will stop to avoid paying for unused server capacity.
When your session stops, all the variables in your notebook are gone. Any files that your code created will be saved and available for the next time when you open your workspace.
So when does the session stop?
- For free users, the session will stop if there is no code running, and the last code execution or notebook edit was 30 minutes ago. Regardless of code running, your session will stop 24 hours after being started.
- For paying users, the session will stop if there is no code running, and the last code execution or notebook edit was 2 hours ago. Regardless of code running, your session will stop 24 hours after being started.
In other words, if you are running cells that take a long time to complete, this cell will continue running until completion, after which you still have 30 minutes (or 2 hours) to pick up the work again. It is important that you keep the workspace tab open and your computer running at all times, though. If you close the tab or your computer goes to sleep, your session will be closed within 5 minutes.
An example to clarify: Mia is a free Workspace users and starts a workspace that does some hyperparameter tuning for a random forest regression model, which takes 4 hour to complete. She leaves the workspace tab open and comes back 10 minutes after the tuning step completed. The workspace session is still active, so Mia can interactively explore the variables that were created in the process. Mia then goes for dinner and returns back to her workspace. She finds that her workspace session closed, since she has been idle for more than 30 minutes. She can still see the contents of her workspace okay, but the variables are gone.