Stretch: How to configure systemctl hibernate correctly?

Kernels & Hardware, configuring network, installing services

Stretch: How to configure systemctl hibernate correctly?

Postby Meow » 2020-12-13 13:26

Debian Stretch's way of hibernating/resuming (via systemctl hibernate) is quite unusual:
first, swap out what can be swapped out
then, store the rest (kernel and non-swappable parts of user memory) as hibernation image.

This is extremely annoying, as the system is laggy to unresponsive a very long time (10-20 minutes) until the most important of the dozens of gigabytes of swapped-out stuff has been swapped in again.

If possible, I would like to configure hibernate/resume so that the first step (swap out what can be swapped out) is omitted and instead just the whole memory is being written to the hibernation file, and read back in one piece when resuming.
This would have the advantage of the computer being fully usable directly after resuming, without constantly having to wait at an unresponsive computer each time some thread is being swapped in again.

Any idea if, and how the hibernation/resume can be configured this way?
User avatar
Meow
 
Posts: 22
Joined: 2015-04-13 23:32

Re: Stretch: How to configure systemctl hibernate correctly?

Postby Head_on_a_Stick » 2020-12-13 14:01

Not sure about disabling the swapping out stage but you could try to minimise the hibernation image, which should make resuming faster:
Code: Select all
# echo 0 > /sys/power/image_size

Reference: https://www.kernel.org/doc/Documentatio ... erface.txt

If that helps then make it permanent by either adding the command to /etc/rc.local or with systemd-tmpfiles (not sure if that works with stretch's systemd version though).
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13041
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Stretch: How to configure systemctl hibernate correctly?

Postby Meow » 2020-12-13 17:54

Thank you very much, @HeadOnAStick :)

I looked at the /sys/power/image_size and it showed 20 gigabytes.
That might explain why always 20 GB is being stored in the hibernation file, no matter how much memory is actually used (normally around 30, 40GB).
Looks like changing that setting to the actual memory size (48GB) might improve the situation!
I will try it out when I can afford a reboot tonight or tomorrow, and report back :)
User avatar
Meow
 
Posts: 22
Joined: 2015-04-13 23:32


Return to System configuration

Who is online

Users browsing this forum: No registered users and 13 guests

fashionable