diff --git a/content/desktop/images/resource-saver-settings.png b/content/desktop/images/resource-saver-settings.png new file mode 100644 index 0000000000..d492399c81 Binary files /dev/null and b/content/desktop/images/resource-saver-settings.png differ diff --git a/content/desktop/images/resource-saver-status-bar.png b/content/desktop/images/resource-saver-status-bar.png new file mode 100644 index 0000000000..c1724e58e7 Binary files /dev/null and b/content/desktop/images/resource-saver-status-bar.png differ diff --git a/content/desktop/settings/linux.md b/content/desktop/settings/linux.md index dca7649c36..a130d53ad6 100644 --- a/content/desktop/settings/linux.md +++ b/content/desktop/settings/linux.md @@ -51,7 +51,7 @@ network, and other resources. ### Advanced -On the **Advanced** tab, you can limit resources available to Docker. +On the **Advanced** tab, you can limit resources available to the Docker Linux VM. Advanced settings are: @@ -68,11 +68,29 @@ Advanced settings are: - **Disk image location**. Specify the location of the Linux volume where containers and images are stored. -You can also move the disk image to a different location. If you attempt to move a disk image to a location that already has one, you are asked if you want to use the existing image or replace it. + You can also move the disk image to a different location. If you attempt to + move a disk image to a location that already has one, you are asked if you + want to use the existing image or replace it. >**Tip** > -> If you feel Docker Desktop starting to get slow or you're running multi-container workloads, increase the memory and disk image space allocation to something higher. +> If you feel Docker Desktop starting to get slow or you're running +> multi-container workloads, increase the memory and disk image space allocation +{ .tip } + +- **Resource Saver**. Enable or disable [Resource Saver mode](../use-desktop/resource-saver.md), + which significantly reduces CPU and memory utilization on the host by + automatically turning off the Linux VM when Docker Desktop is idle (i.e., no + containers are running). + + You can also configure the Resource Saver timeout which indicates how long + should Docker Desktop be idle before Resource Saver mode kicks in. Default is + 5 minutes. + + >**Note** + > + > Exit from Resource Saver mode occurs automatically when containers run. Exit + > may take a few seconds (~3 to 10 secs) as Docker Desktop restarts the Linux VM. ### File sharing diff --git a/content/desktop/settings/mac.md b/content/desktop/settings/mac.md index d461590070..6102a5b24c 100644 --- a/content/desktop/settings/mac.md +++ b/content/desktop/settings/mac.md @@ -71,7 +71,7 @@ network, and other resources. ### Advanced -On the **Advanced** tab, you can limit resources available to Docker. +On the **Advanced** tab, you can limit resources available to the Docker Linux VM. Advanced settings are: @@ -88,13 +88,31 @@ Advanced settings are: - **Disk image location**. Specify the location of the Linux volume where containers and images are stored. -You can also move the disk image to a different location. If you attempt to move a disk image to a location that already has one, you are asked if you want to use the existing image or replace it. + You can also move the disk image to a different location. If you attempt to + move a disk image to a location that already has one, you are asked if you + want to use the existing image or replace it. >**Tip** > -> If you're running multi-container workloads, increase the memory and disk image space allocation to something higher. +> If you feel Docker Desktop starting to get slow or you're running +> multi-container workloads, increase the memory and disk image space allocation { .tip } +- **Resource Saver**. Enable or disable [Resource Saver mode](../use-desktop/resource-saver.md), + which significantly reduces CPU and memory utilization on the host by + automatically turning off the Linux VM when Docker Desktop is idle (i.e., no + containers are running). + + You can also configure the Resource Saver timeout which indicates how long + should Docker Desktop be idle before Resource Saver mode kicks in. Default is + 5 minutes. + + >**Note** + > + > Exit from Resource Saver mode occurs automatically when containers run. Exit + > may take a few seconds (~3 to 10 secs) as Docker Desktop restarts the Linux VM. + + ### File sharing Use File sharing to allow local directories on your machine to be shared with diff --git a/content/desktop/settings/windows.md b/content/desktop/settings/windows.md index 62fdadb7ea..ee34d41950 100644 --- a/content/desktop/settings/windows.md +++ b/content/desktop/settings/windows.md @@ -51,7 +51,7 @@ On the **General** tab, you can configure when to start Docker and specify other > > This setting is only available if you are signed in to Docker Desktop and have a Docker Business subscription. -- **Show CLI hints**. Displays CLI hints and tips when running Docker commands in the CLI. This is turned on by default. To turn CLI hints on or off from the CLI, set `DOCKER_CLI_HINTS` to `true` or `false` respectively. +- **Show CLI hints**. Displays CLI hints and tips when running Docker commands in the CLI. This is turned on by default. To turn CLI hints on or off from the CLI, set `DOCKER_CLI_HINTS` to `true` or `false` respectively. ## Resources @@ -70,7 +70,7 @@ containers. > mode, you can configure limits on the memory, CPU, and swap size allocated > to the [WSL 2 utility VM](https://docs.microsoft.com/en-us/windows/wsl/wsl-config#configure-global-options-with-wslconfig). -On the **Advanced** tab, you can limit resources available to Docker. +On the **Advanced** tab, you can limit resources available to the Docker Linux VM. Advanced settings are: @@ -87,7 +87,29 @@ Advanced settings are: - **Disk image location**. Specify the location of the Linux volume where containers and images are stored. -You can also move the disk image to a different location. If you attempt to move a disk image to a location that already has one, you are asked if you want to use the existing image or replace it. + You can also move the disk image to a different location. If you attempt to + move a disk image to a location that already has one, you are asked if you + want to use the existing image or replace it. + +>**Tip** +> +> If you feel Docker Desktop starting to get slow or you're running +> multi-container workloads, increase the memory and disk image space allocation +{ .tip } + +- **Resource Saver**. Enable or disable [Resource Saver mode](../use-desktop/resource-saver.md), + which significantly reduces CPU and memory utilization on the host by + automatically turning off the Linux VM when Docker Desktop is idle (i.e., no + containers are running). + + You can also configure the Resource Saver timeout which indicates how long + should Docker Desktop be idle before Resource Saver mode kicks in. Default is + 5 minutes. + + >**Note** + > + > Exit from Resource Saver mode occurs automatically when containers run. Exit + > may take a few seconds (~3 to 10 secs) as Docker Desktop restarts the Linux VM. ### File sharing @@ -229,7 +251,7 @@ You can find this file at `$HOME/.docker/daemon.json`. To change the configurati edit the JSON configuration directly from the dashboard in Docker Desktop, or open and edit the file using your favorite text editor. -To see the full list of possible configuration options, see the +To see the full list of possible configuration options, see the [dockerd command reference](/engine/reference/commandline/dockerd/). Select **Apply & Restart** to save your settings and restart Docker Desktop. @@ -284,7 +306,7 @@ Use the **Extensions** tab to: For more information about Docker extensions, see [Extensions](../extensions/index.md). -## Feature control +## Feature control On the **Feature control** tab you can control your settings for **Beta features** and **Experimental features**. @@ -300,4 +322,4 @@ Turns on the containerd image store. This brings new features like faster contai ### Experimental features -{{< include "desktop-experimental.md" >}} \ No newline at end of file +{{< include "desktop-experimental.md" >}} diff --git a/content/desktop/use-desktop/pause.md b/content/desktop/use-desktop/pause.md index 11ac3d072a..2a2548be85 100644 --- a/content/desktop/use-desktop/pause.md +++ b/content/desktop/use-desktop/pause.md @@ -4,17 +4,13 @@ keywords: Docker Dashboard, manage, containers, gui, dashboard, pause, user manu title: Pause Docker Desktop --- -When Docker Desktop is paused, the Linux VM running Docker Engine is paused, the current state of all your containers are saved in memory, and all processes are frozen. This reduces the CPU and memory usage and helps you retain a longer battery life on your laptop. - -You can either manually pause Docker Desktop or turn on the Resource Saver feature which automatically pauses Docker Desktop when no container is running. +When Docker Desktop is paused, the Linux VM running Docker Engine is paused, the current state of all your containers are saved in memory, and all processes are frozen. This reduces the CPU and memory usage and helps you retain a longer battery life on your laptop. You can manually pause Docker Desktop by selecting the Docker menu {{< inline-image src="../images/whale-x.svg" alt="whale menu" >}} and then **Pause**. To manually resume Docker Desktop, select the **Resume** option in the Docker menu, or run any Docker CLI command. When you manually pause Docker Desktop, a paused status displays on the Docker menu and on the Docker Dashboard. You can still access the **Settings** and the **Troubleshoot** menu. -When Resource Saver kicks in, a leaf icon display on the Docker menu. - -> **Important** +>**Note** > ->Resource Saver is currently an experimental feature. To access this feature, make sure you have turned on access to experimental features in settings. -{ .important } \ No newline at end of file +> The Resource Saver feature (v4.24+) is enabled by default and provides better +> CPU and memory savings and the manual Pause feature. See [here](resource-saver.md) for more info. diff --git a/content/desktop/use-desktop/resource-saver.md b/content/desktop/use-desktop/resource-saver.md new file mode 100644 index 0000000000..d7dba6bd47 --- /dev/null +++ b/content/desktop/use-desktop/resource-saver.md @@ -0,0 +1,94 @@ +--- +description: understand what Docker Desktop Resource Saver is +keywords: Docker Dashboard, resource saver, manage, containers, gui, dashboard, user manual +title: Docker Desktop's Resource Saver mode +--- + +Resource Saver is a new feature .available in Docker Desktop version 4.24 and later, that significantly reduces Docker +Desktop's CPU and memory utilization on the host by 2 GBs or more, by +automatically stopping the Docker Desktop Linux VM when no containers are +running for a period of time (defaults to 5 minutes). + +This way, Docker Desktop uses minimal system resources when it's idle, thereby +allowing you to save battery life on your laptop and improve your multi-tasking +experience. + +Resource Saver is enabled by default but can be disabled via the Dashboard's +Settings -> Resources -> Advanced menu. You can also configure the idle +timer as shown below. + +![Resource Saver Settings](../images/resource-saver-settings.png) + +When Docker Desktop enters Resource Saver mode, a leaf icon is displayed on the +Docker Desktop status bar (see figure below) as well as in the Docker icon on +the system tray. As shown, the Linux VM CPU and memory utilization are reduced +to zero. + +![Resource Saver Status Bar](../images/resource-saver-status-bar.png) + +>**Note** +> +> Exit from Resource Saver mode occurs automatically when containers run. Exit +> may take a few seconds (~3 to 10 secs) as Docker Desktop restarts the Linux VM. +> It's generally faster on Mac and Linux, and a bit slower on Windows (with Hyper-V). + +A bit more info about Resource Saver: + +* The Resource Saver timer is configured to 5 minutes by default. That is, + Docker Desktop will enter Resource Saver mode if no containers are running for + 5 minutes. Depending on your needs, you can adjust this to a lower or higher + value. + +* Keep in mind that exit from Resource Saver mode occurs automatically when + containers run, but starting the first such container will incur the Resource + Saver exit delay which can take between ~3 -> 10 seconds as Docker Desktop + restarts the Linux VM. The restart is generally faster on Mac and Linux, and a + bit slower on Windows with Hyper-V. Once the Linux VM is restarted, subsequent + container runs will occurs immediately as usual. + +* Resource Saver works a bit differently on Windows with WSL. Instead of + stopping the WSL VM, it only pauses the Docker Engine inside the + `docker-desktop` WSL distro. That's because in WSL there's a single Linux VM + shared by all WSL distros, so Docker Desktop can't stop the Linux VM (i.e., + the WSL Linux VM is not owned by Docker Desktop). As a result, Resource Saver + reduces CPU utilization on WSL, but it does not reduce Docker's memory + utilization. To reduce memory utilization on WSL, we instead recommend that + users enable WSL's `autoMemoryReclaim` feature as described in the + [Docker Desktop WSL docs](../wsl/_index.md). Finally, since Docker Desktop does not + stop the Linux VM on WSL, exit from Resource Saver mode is immediate (there's + no exit delay). + +* When Docker Desktop enters Resource Saver mode, Docker commands that don't run + containers (e.g., listing container images or volumes) do not necessarily + trigger an exit from Resource Saver mode as Docker Desktop can serve such + commands without unnecessarily waking up the Linux VM. + +* Resource Saver has higher precedence than the older [Pause](pause.md) feature, + meaning that while Docker Desktop is in Resource Saver mode, manually pausing + Docker Desktop is not possible (nor does it make sense since Resource Saver + actually stops the Docker Desktop Linux VM). In general, we recommend keeping + Resource Saver enabled as opposed to disabling it and using the manual Pause + feature, as it results in much better CPU and memory savings. + +* When configuring the Resource Saver timer, if the values available via the + Dashboard GUI (Settings -> Resources -> Advanced) are not sufficient for your + needs, you can reconfigure it to any value (must be larger than 30 seconds) by + changing `autoPauseTimeoutSeconds` in the Docker Desktop `settings.json` file + (there's no need to restart Docker Desktop after reconfiguring): + + - **Mac**: `~/Library/Group Containers/group.com.docker/settings.json` + - **Windows**: `C:\Users\[USERNAME]\AppData\Roaming\Docker\settings.json` + - **Linux**: `~/.docker/desktop/settings.json` + +* Resource Saver was initially introduced in Docker Desktop v4.21 as an + experimental feature, where it simply paused the Linux VM when no containers + were running for 30 seconds. In v4.22 it was improved to stop (not just pause) + the Linux VM when no containers were running for 30 seconds. In v4.24, it was + promoted to a full feature (i.e., it's no longer experimental), the Resource + Saver timeout was increased from 30 seconds to 5 minutes, and the + configuration controls became available via the Dashboard's Settings -> Resources -> Advanced menu. + +* We continuously strive to improve Docker Desktop; if you find any problem with + the Resource Saver feature, please file a ticket on the appropriate Docker + Desktop GitHub repo (e.g., [for-mac](https://github.com/docker/for-mac), + [for-win](https://github.com/docker/for-win)). diff --git a/content/desktop/wsl/_index.md b/content/desktop/wsl/_index.md index fbc423f291..cd7607a175 100644 --- a/content/desktop/wsl/_index.md +++ b/content/desktop/wsl/_index.md @@ -14,7 +14,7 @@ Windows Subsystem for Linux (WSL) 2 is a full Linux kernel built by Microsoft, w Docker Desktop uses the dynamic memory allocation feature in WSL 2 to improve the resource consumption. This means Docker Desktop only uses the required amount of CPU and memory resources it needs, while allowing CPU and memory-intensive tasks such as building a container, to run much faster. -Additionally, with WSL 2, the time required to start a Docker daemon after a cold start is significantly faster. +Additionally, with WSL 2, the time required to start a Docker daemon after a cold start is significantly faster. ## Prerequisites @@ -24,6 +24,24 @@ Before you turn on the Docker Desktop WSL 2 feature, ensure you have: - Windows 10, version 21H2 or later, or Windows 11, version 21H2 or later. For more information, see [System requirements](https://docs.docker.com/desktop/install/windows-install/#system-requirements). - Installed the WSL 2 feature on Windows. For detailed instructions, refer to the [Microsoft documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10). +>**Tip** +> +> For a better experience on WSL, consider enabling the WSL `autoMemoryReclaim` feature available since WSL 1.3.10 (experimental). +> You can do this by adding the following to the `.wslconfig` file and restarting WSL. +> +> ``` +> [experimental] +> autoMemoryReclaim=true +> ``` +> +> This feature causes the Windows host to better reclaim unused memory inside +> the WSL virtual machine, thereby resulting in better memory availability to +> other host applications. This is particularly helpful with Docker Desktop, +> since otherwise the WSL VM may consume large amounts (GBs) of memory in the +> Linux kernel's page cache as Docker builds container images, without ever +> returning that memory to the host when it becomes unused inside the VM. +{ .tip } + ## Turn on Docker Desktop WSL 2 > **Important** @@ -84,4 +102,4 @@ Docker Desktop does not require any particular Linux distros to be installed. Th ## Additional resources - [Explore best practices](best-practices.md) -- [Understand how to develop with Docker and WSL 2 and GPU support for WSL](use-wsl.md) \ No newline at end of file +- [Understand how to develop with Docker and WSL 2 and GPU support for WSL](use-wsl.md) diff --git a/data/toc.yaml b/data/toc.yaml index 172132a25c..c394abe73a 100644 --- a/data/toc.yaml +++ b/data/toc.yaml @@ -647,7 +647,7 @@ Reference: - path: /engine/reference/commandline/scout_repo/ title: docker scout repo - path: /engine/reference/commandline/scout_repo_disable/ - title: docker scout repo disable + title: docker scout repo disable - path: /engine/reference/commandline/scout_repo_enable/ title: docker scout repo enable - path: /engine/reference/commandline/scout_repo_list/ @@ -1158,6 +1158,8 @@ Manuals: title: Explore Volumes - path: /desktop/use-desktop/builds/ title: Explore Builds (Beta) + - path: /desktop/use-desktop/resource-saver/ + title: Resource Saver mode - path: /desktop/use-desktop/pause/ title: Pause Docker Desktop - sectiontitle: Hardened Docker Desktop @@ -2242,13 +2244,13 @@ FAQ: - sectiontitle: Desktop section: - path: /desktop/faqs/general/ - title: General + title: General - path: /desktop/faqs/macfaqs/ - title: Mac + title: Mac - path: /desktop/faqs/windowsfaqs/ - title: Windows + title: Windows - path: /desktop/faqs/linuxfaqs/ - title: Linux + title: Linux - path: /desktop/faqs/releases/ title: Releases - sectiontitle: Docker Hub and admin @@ -2275,4 +2277,3 @@ FAQ: title: Manage users - path: /subscription/faq/ title: Subscription -