fix(autopause): stop container on idle instead of pausing - #951
Open
QwertyJacob wants to merge 1 commit into
Open
fix(autopause): stop container on idle instead of pausing#951QwertyJacob wants to merge 1 commit into
QwertyJacob wants to merge 1 commit into
Conversation
When AUTOPAUSE is triggered, winapps previously called 'docker compose pause' (or podman/libvirt suspend equivalents). For QEMU/KVM virtual machines (such as dockur/windows), freezing QEMU with cgroups freezer breaks clock synchronization between host KVM and guest vCPUs, causing QEMU threads to spin continuously at ~150% host CPU load. Additionally, 'docker ps' still lists the container as 'Up (Paused)', leaving host RAM and CPU allocated. Changing the idle action from 'pause' to 'stop' (and 'virsh shutdown') cleanly stops the VM, drops CPU usage to 0%, releases host RAM, and allows winapps to seamlessly restart the VM on the next application invocation.
Member
|
I'll have to investigate this. Can you please
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR updates the
AUTOPAUSEfunctionality inbin/winappsto stop (docker compose stop/podman-compose stop/virsh shutdown) idle virtual machines rather than pausing (docker compose pause/virsh suspend).Problem Addressed
When
AUTOPAUSE="on"triggers after the idle timeout:winappsexecuteddocker compose pause. In Docker,pauseuses Linux cgroups freezer to freeze process execution in memory. This keeps the container listed asUp (Paused)indocker psand leaves all host RAM allocated.dockur/windows), freezing QEMU with cgroups freezer breaks clock/timer synchronization between host KVM and guest vCPUs. This causes QEMU helper threads to spin continuously at ~150% host CPU load in kernel space, causing severe host CPU overheating and maximum fan speeds.Solution
pausewithstop(docker compose stop,podman-compose stop) andvirsh shutdownwhenSUSPEND_WINDOWSis triggered inwaCheckIdle.Stopping Windows due to inactivity.stopis called, the VM gracefully shuts down, dropping host CPU usage to 0% and releasing host RAM completely.winappsalready natively handles booting from anexitedcontainer status inwaCheckContainerRunning(docker compose start), so next time a user opens any WinApp shortcut, Windows boots up automatically and transparently.