Skip to content

Commit

Permalink
Document persistent sessions (#37)
Browse files Browse the repository at this point in the history
* document persistent sessions

* satisfy vale
  • Loading branch information
jmcphers authored Jan 22, 2025
1 parent cc3af68 commit 4975760
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Binary file added images/remote-ssh-shutdown-timeout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions remote-ssh.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,28 @@ For example, note that this Shiny application running on `:6868` automatically g

![Port Forwarding for Local Web Content](./images/remote-ssh-port-forwarding.png)

## Long-running sessions

By default, Positron will forcefully end your R and Python sessions when you close Positron. If you want to leave your sessions running even after you close Positron -- for example, to leave data loaded in memory or let long-running computations continue -- you can tell Positron's kernel supervisor to keep the sessions running. You can find this setting in _Settings > Extensions > Kernel Supervisor > Shutdown Timeout_.

![Shutdown Timeout Settings](./images/remote-ssh-shutdown-timeout){width=638}

Note that this setting only takes effect after restarting Positron!

### Resuming sessions

The long-running sessions are associated with the workspace in which you use them. When you reopen a workspace that contains active sessions, Positron will automatically reconnect to the sessions if it finds any that are still running.

### Shutdown timeout details

Because the supervisor runs your R and Python sessions without any UI attached, it can't tell when you're done with them. In order to prevent sessions from running indefinitely and consuming resources on your remote host, the supervisor will shut them down after a certain period of inactivity. This period is controlled by _Shutdown Timeout_ setting.

The shutdown timeout will never interrupt a kernel that's busy running code; it doesn't start counting down until the kernel is idle _and_ it's not connected to any Positron windows.

If you just want to allow your kernels to finish any running computations when you exit Positron, use the _when idle_ setting.

There's also an option to allow the kernels to run forever; if you use this option, your R and Python kernels will never exit unless you manually kill the processes or shut them down from Positron. We don't generally recommend using this option unless you are familiar with process management on your remote host, since it can lead to resource exhaustion.

## How it works & troubleshooting

When Positron connects to a new host for the first time, it does the following:
Expand All @@ -95,3 +117,4 @@ If you need to use a different URL to download Positron Server (for example to u
![Remote SSH: Server Download Url Template Setting](./images/remote-ssh-server-template.png){width=650}

Note that the client and server must be using **exactly** the same Positron version.

0 comments on commit 4975760

Please sign in to comment.