To prevent runaway charges when no computational work is being done in a Terra notebook or through your workspace's terminal, the cloud environment automatically pauses when there is no web browser or notebook activity for 30 minutes.
Note: Notebook activity only prevents autopause for up to 24 hours. This article explains how autopause on Terra works by default and how to manually override the default settings.
Autopause overview
When does autopause happen by default?
By default, cloud environments autopause after 30 minutes of browser inactivity. Browser inactivity includes:
- Closing the browser tab that contains the still running Terra cloud environment
- Closing your computer, which causes your laptop to go to sleep
- Your laptop going to sleep on its own (due to configuration settings)
Once you do any of the above and 30 minutes pass, the cloud environment autopauses.
What actions prevent the default autopause?
- If you come back (click into the browser) before 30 minutes pass, your cloud environment will not autopause (until another 30 minutes of inactivity have passed).
- If you run a notebook analysis and the kernel is active, there is no autopause.
Don't leave your browser tab open if your computer never goes to sleep Your cloud environment will never pause if you don't close your cloud environment browser tab and your computer is set to never go to sleep. This can be dangerous, as it could incur large and unanticipated costs.
What happens after autopausing?
If you come back after 30 minutes of inactivity, you have to unpause your cloud environment, which can take up to two minutes.
You won't lose any notebook outputs that were already explicitly written to a file, since the cloud environment (aka "boot disk") is not deleted. And of course, you won't lose any output you copied to an external Google bucket. However, notebook output generated while the browser is inactive will not show up in the notebook cells.
In addition, environment variables (such as workspace name or billing project) will be reset. For example, you may need to rerun notebook cells that retrieve environment variables.
How does autopause work?
- Autopause attempts to trigger every 30 minutes when no browser activity is detected.
- If the notebook's kernel is still busy after 30 minutes, the notebook continues to run.
- When the kernel shuts off, autopause occurs at the end of the next 30-minute interval.
- Because the notebook isn't connected to the browser, outputs written to cells won't be visible in the notebook user interface. However, any output written to external files can be accessed directly.
- Kernel activity only prevents autopause for 24 hours.
Kernel activity prevents autopause for up to 24 hours
To allow long-running notebook jobs that generate output files to finish, kernel activity prevents autopause, even if the browser is inactive for 30 minutes.
To protect you from out-of-control costs linked with executing an operation that unintentionally keeps the kernel active, autopause pauses the Cloud Environment - even if the kernel is active - after 24 hours.
Accessing analysis output generated when the browser is inactiveNote: In this case, because the browser is inactive, outputs written to notebook cells won't be visible in the notebook user interface. Only outputs written to files external to the notebook are retained.
How do I know the notebook kernel is running?
When the kernel autopauses, the Cloud Environment goes from Running -> Stopping -> Stopped in the user interface. In the screenshot below, you see the Cloud Environment is running. You can click the pause button to pause the Cloud Environment.
Note: The kernel indicator icon (circled in orange) is only filled in when a cell is running in the notebook, and empty when no cells are running (i.e., when the kernel is "idle"):
Adjusting/overriding autopause
You may want to override the default settings for autopause if:
- You want a longer or shorter autopause threshold.
- You are running a long-running RStudio or Galaxy analysis and will be away from your browser for more than half an hour.
You can adjust the minutes of activity that trigger autopause when you customize your Cloud Environment.
Overriding autopause can leave you vulnerable to accruing considerable costsIt is important to be very careful when adjusting the default settings.
For more information, see this article on How to adjust Cloud Environments' autopause.