Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Stretch: How to configure systemctl hibernate correctly?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
Meow
Posts: 29
Joined: 2015-04-13 23:32
Has thanked: 5 times

Stretch: How to configure systemctl hibernate correctly?

#1 Post by Meow »

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
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Stretch: How to configure systemctl hibernate correctly?

#2 Post by Head_on_a_Stick »

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).
deadbang

User avatar
Meow
Posts: 29
Joined: 2015-04-13 23:32
Has thanked: 5 times

Re: Stretch: How to configure systemctl hibernate correctly?

#3 Post by Meow »

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 :)

Post Reply