Skip to content

Commit e36e9d7

Browse files
authored
Merge pull request #222084 from lebaro-msft/patch-11
Improving session management documentation
2 parents 93b38a6 + 940fbfe commit e36e9d7

File tree

6 files changed

+64
-6
lines changed

6 files changed

+64
-6
lines changed

articles/machine-learning/how-to-access-terminal.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ Access all Git operations from the terminal. All Git files and folders will be s
6363
6464
To integrate Git with your Azure Machine Learning workspace, see [Git integration for Azure Machine Learning](concept-train-model-git-integration.md).
6565

66-
6766
## Install packages
6867

6968
Install packages from a terminal window. Install Python packages into the **Python 3.8 - AzureML** environment. Install R packages into the **R** environment.
@@ -79,7 +78,7 @@ Or you can install packages directly in Jupyter Notebook, RStudio, or Posit Work
7978
## Add new kernels
8079

8180
> [!WARNING]
82-
> While customizing the compute instance, make sure you do not delete the **azureml_py36** or **azureml_py38** conda environments. Also do not delete **Python 3.6 - AzureML** or **Python 3.8 - AzureML** kernels. These are needed for Jupyter/JupyterLab functionality.
81+
> While customizing the compute instance, make sure you do not delete the **azureml_py36** or **azureml_py38** conda environments. Also do not delete **Python 3.6 - AzureML** or **Python 3.8 - AzureML** kernels. These are needed for Jupyter/JupyterLab functionality.
8382
8483
To add a new Jupyter kernel to the compute instance:
8584

@@ -106,12 +105,14 @@ To add a new Jupyter kernel to the compute instance:
106105
Any of the [available Jupyter Kernels](https://github.com/jupyter/jupyter/wiki/Jupyter-kernels) can be installed.
107106

108107
### Remove added kernels
108+
109109
> [!WARNING]
110-
> While customizing the compute instance, make sure you do not delete the **azureml_py36** or **azureml_py38** conda environments. Also do not delete **Python 3.6 - AzureML** or **Python 3.8 - AzureML** kernels. These are needed for Jupyter/JupyterLab functionality.
110+
> While customizing the compute instance, make sure you do not delete the **azureml_py36** or **azureml_py38** conda environments. Also do not delete **Python 3.6 - AzureML** or **Python 3.8 - AzureML** kernels. These are needed for Jupyter/JupyterLab functionality.
111111

112112
To remove an added Jupyter kernel from the compute instance, you must remove the kernelspec, and (optionally) the conda environment. You can also choose to keep the conda environment. You must remove the kernelspec, or your kernel will still be selectable and cause unexpected behavior.
113113

114114
To remove the kernelspec:
115+
115116
1. Use the terminal window to list and find the kernelspec:
116117

117118
```shell
@@ -125,13 +126,14 @@ To remove the kernelspec:
125126
```
126127
127128
To also remove the conda environment:
129+
128130
1. Use the terminal window to list and find the conda environment:
129131
130132
```shell
131133
conda env list
132134
```
133135
134-
3. Remove the conda environment, replacing ENV_NAME with the conda environment you'd like to remove:
136+
1. Remove the conda environment, replacing ENV_NAME with the conda environment you'd like to remove:
135137

136138
```shell
137139
conda env remove -n ENV_NAME
@@ -141,7 +143,11 @@ Upon refresh, the kernel list in your notebooks view should reflect the changes
141143

142144
## Manage terminal sessions
143145

144-
Select **View active sessions** in the terminal toolbar to see a list of all active terminal sessions. When there are no active sessions, this tab will be disabled.
146+
Terminal sessions can stay active if terminal tabs are not properly closed. Too many active terminal sessions can impact the performance of your compute instance.
147+
148+
Select **Manage active sessions** in the terminal toolbar to see a list of all active terminal sessions and shut down the sessions you no longer need.
149+
150+
Learn more about how to manage sessions running on your compute at [Managing notebook and terminal sessions](how-to-manage-compute-sessions.md).
145151

146152
> [!WARNING]
147-
> Make sure you close any unused sessions to preserve your compute instance's resources. Idle terminals may impact performance of compute instances.
153+
> Make sure you close any sessions you no longer need to preserve your compute instance's resources and optimize your performance.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: How to manage compute sessions
3+
titleSuffix: Azure Machine Learning
4+
description: Use the session management panel to manage the active notebook and terminal sessions running on a compute instance.
5+
services: machine-learning
6+
author: lebaro-msft
7+
ms.author: lebaro
8+
ms.reviewer: sgilley
9+
ms.service: machine-learning
10+
ms.subservice: core
11+
ms.topic: how-to
12+
ms.date: 12/21/2022
13+
# Customer intent: As a data scientist, I want to manage the notebook and terminal sessions on my compute instance for optimal performance.
14+
---
15+
16+
# Manage notebook and terminal sessions
17+
18+
Notebook and terminal sessions run on the compute and maintain your current working state.
19+
20+
When you reopen a notebook, or reconnect to a terminal session, you can reconnect to the previous session state (including command history, execution history, and defined variables). However, too many active sessions may slow down the performance of your compute. With too many active sessions, you may find your terminal or notebook cell typing lags, or terminal or notebook command execution may feel slower than expected.
21+
22+
There's a session management panel in the Azure Machine Learning studio that helps you manage your active sessions and optimize the performance of your compute instance. You can navigate to this session management panel from the compute toolbar of either a terminal tab or a notebook tab.
23+
24+
> [!NOTE]
25+
> For optimal performance, we recommend you don’t keep more than six active sessions - and the fewer the better.
26+
27+
:::image type="content" source="media/how-to-manage-compute-sessions/compute-session-management-panel.png" alt-text="Screenshot of compute session management panel.":::
28+
29+
## Notebook sessions
30+
31+
In the session management panel, you can select a linked notebook name in the notebook sessions section to reopen a notebook with its previous state.
32+
33+
Notebook sessions are kept active when you close a notebook tab in the Azure Machine Learning studio. So, when you reopen a notebook you'll have access to previously defined variables and execution state - in this case, you're benefitting from the active notebook session.
34+
35+
However, keeping too many active notebook sessions can slow down the performance of your compute. So, you should use the session management panel to shut down any notebook sessions you no longer need.
36+
37+
Select **Manage active sessions** in the terminal toolbar to open the session management panel and shut down the sessions you no longer need. In the following image, you can see that the tooltip shows the count of active notebook sessions.
38+
39+
:::image type="content" source="media/how-to-manage-compute-sessions/notebook-sessions-button.png" alt-text="Screenshot of notebooks sessions button in toolbar.":::
40+
41+
## Terminal sessions
42+
43+
In the session management panel, you can select on a terminal link to reopen a terminal tab connected to that previous terminal session.
44+
45+
In contrast to notebook sessions, terminal sessions are terminated when you close a terminal tab. However, if you navigate away from the Azure Machine Learning studio without closing a terminal tab, the session may remain open. You should be shut down any terminal sessions you no longer need by using the session management panel.
46+
47+
Select **Manage active sessions** in the terminal toolbar to open the session management panel and shut down the sessions you no longer need. In the following image, you can see that the tooltip shows the count of active terminal sessions.
48+
49+
:::image type="content" source="media/how-to-manage-compute-sessions/terminal-sessions-button.png" alt-text="Screenshot of terminal sessions button in toolbar.":::
50.9 KB
Loading
51.4 KB
Loading
23.6 KB
Loading

articles/machine-learning/toc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,9 @@
423423
- name: Use a terminal
424424
displayName: git, github, clone, kernel, package
425425
href: how-to-access-terminal.md
426+
- name: Manage compute sessions
427+
displayName: sessions, terminal, kernel
428+
href: how-to-manage-compute-sessions.md
426429
- name: Set up VS Code extension
427430
displayName: Visual Studio Code, VSCode, debug, bugs, remote, compute, instance
428431
href: how-to-setup-vs-code.md

0 commit comments

Comments
 (0)