New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it easier to configure VM swap space #4880
Comments
Would one of the devs please advise why partition xvdc3 was added to a standard instal (apart from breaking this script)? |
The /dev/xvdc3 is there to ease using that space for something else - you can simply use that partition as is. Some use it for swap, others for bigger /tmp or /var/tmp, there are different opinions. |
FWIW: I really appreciate your effort in filing this ticket. Having just experienced the OOM killer tragically murder a valuable process (even with my 64gb of RAM), I was on the hunt to increase domN swap, and (assuming there are no contraindications) I think your three-line suggestion will work well for any vm that I get an OOM death! |
Just commenting to link #6659 as relevant/related. |
Couple questions on the way forward:
If so, perhaps user configured swap size in qvm-preferences/gui could be part of that approach, maybe with future support for additional user-customizable volatile partitions using GPT? B |
Not yet. I've tried to use dm-thin to share CoW space between root and private (to sidestep having new partition layout there), but wasn't happy about it (startup performance among other issues).
I guess it should be. Currently it defaults to 10GB (or rather: same as default root volume size). But it can be resized with
I'd like to keep this part as simple as possible (another reason why I didn't liked
That said, I think the layout can include a partition for user to use ( |
Qubes OS version:
4.0
Affected component(s) or functionality:
core + Qubes Manager
Steps to reproduce the behavior:
Larger VMs need more than the standard 1G of swap otherwise kernel issues "out of memory" eventually.
All VM swap partitions are misaligned, starting directly at the end of the dos partition table in xvdc (sect 1).
All VM swaps do not have discard set to return unused pages to the thin pool, so if swap is turning over, even slowly, the kernel will colour all the pages of swap and keep all the disk space allocated.
Expected or desired behavior:
Given the ease of use of Qubes Manager for controlling resources of a VM I expect the swap space to be able to be set in Qubes Manager/Settings/Advanced along with private disk space. I suggest a line under private disk space that, in its simplest implementation, is red stared and only settable when the qube is not running. A more ambitious implementation would have the down tick greyed out when running but allow increasing on the fly with an additional swap partition created by the "Apply" button. Of course the property needs to be a exposed by qvm-prefs as well.
Since 4.1 is targeting usability - I suggest this is an appropriate enhancement, especially for those memory constrained.
Actual behavior:
As a new user it was difficult to find how to extend VM swap and it just seemed to belong on the Qubes Manager advanced settings page.
Misalignment slows down swap.
Not having discard enabled fills up your disk unnecessarily.
General notes:
My hack to get around these problems in the current 4.0 setup was to add this script to all my templates and call it from the top of rc.local with the appropriate required swap size (not exactly user friendly):
Ended up doing all my sys+appVMs. Allocated swap disk space tracks swap used, lagging 60-100MB when declining. I also tested using all 10G of xvdc and it behaved as expected using:
Note systemd does try to remount xvdc1 a few times and I thought that was a lead into where to do this change properly... no luck there, also fstab is not updated.
I have consulted the following relevant documentation:
I could not find any answer to the question of extending VM swap, only others asking. I posted this topic to the mailing list: https://groups.google.com/forum/#!topic/qubes-users/AVimvVal47g and awokd did provide a reference to his IAQ that I did not originally find, even with a Duck search on the site. Unfortunately the answer was not that useful. @unman gave me the lead into a solution to the issue, thank you.
This has been running here since not long after that post.
I am aware of the following related, non-duplicate issues:
The text was updated successfully, but these errors were encountered: