• Welcome to Peterborough Linux User Group (Canada) Forum.
 

Hibernation and other energy modes in Linux distros

Started by Jason, December 30, 2018, 10:05:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jason

#15
Quote from: fox on December 31, 2018, 04:39:33 PM
I don't know what the delay would be if Rapid Start isn't enabled. If it was more than 20 sec, I would say that the time saving of hibernating the laptop (for long periods of time) would not make it worth doing.

That depends on how long it's been off. In my BIOS, there is the enabling/disabling of Rapid Start setting and a time setting underneath it. The choices it lists are:

       
  • Immediately
  • 10 minutes
  • 2 hours
  • 5 hours
  • 24 hours
The default is 2 hours. So when it's enabled and I choose to hibernate the laptop, up to two hours, it is actually in Standby mode (the lowest power settings though, also called deep sleep, I believe) so it boots fast though it's not instantaneous. I think the 20 seconds is about right. But at/after 2 hours, it switches from standby to hibernate. At that point, it is essentially powered down. Turn it on after that, it will take longer to boot as it has to read whatever was in RAM at the time from the disk back into memory. I kind of thought I had made that clear earlier but I guess not.

QuoteThis is an interesting thread! I got this idea of long-period hibernation of a laptop from the way phones and tablets work. I use my laptop more or less like a tablet when I'm not traveling or making presentations. I never thought about the trade-offs of laptop hibernation vs shutdown until now. Hypothetically, the same arguments apply to a tablet. Do any of you actually shut down your tablets when you aren't using them for a day or so?

Phones and tablets aren't hibernating, they're just sleeping until you use them though it would be the lowest energy form of sleep. And coming out of a hibernation isn't fast (it may or may not be faster than booting depending on what you were working on). But it saves a lot of energy and lets you go back to working on your tasks after the disk back to ram transfer.

QuoteHypothetically, the same arguments apply to a tablet. Do any of you actually shut down your tablets when you aren't using them for a day or so?

I find it takes much longer to start my phone or my tablet if it's actually powered down than my PC or laptop. So I only restart (not power down) my phone or tablet about once a week. I don't usually go a day without using them, especially my phone. I have a game on it I particularly like so I play it every night before I got to bed and I also use the phone to check the news, texts, facebook and email when I'm away from home.

I don't find the 30-45 seconds it takes to start my desktop or laptop a big deal. I won't shut my desktop if I'm coming back to it in an hour but otherwise I do. With my laptop, I shut it down if I'm not using it for 10-20 minutes unless it's doing something like getting updates.

It's great that you bike but airplanes are horrible for CO2 emissions but I understand they're still necessary unless you have the time to travel another way and many don't.

And true, these devices don't use a lot of power compared to other things, and here in Ontario, about 75% of our electricity doesn't produce CO2 emissions but I think every little bit helps. Boot time for laptops and desktops are one of those things where the environment is worth more than my inconvenience, at least in my mind.

But I admit when I reach for my tablet, I don't really want to wait for it to boot - it just takes too damn long. I think Harry makes a good point in powering down at night though. Really no reason to leave it on while we sleep unless it's an alarm clock. I wouldn't power down the phone though, what if there is a family emergency or a national catastrophe? But maybe for Harry these things don't happen or just getting sleep is more important. No judgement, I totally get that :)
* Zorin OS 17.1 Core and Windows 11 Pro on a Dell Precision 3630 Tower with an
i5-8600 3.1 GHz 6-core processor, dual 22" displays, 16 GB of RAM, 512 GB Nvme and a Geforce 1060 6 GB card
* Motorola Edge (2022) phone with Android 13

Jason

After going to complete shutdown from within Manjaro, my system went down 2% over a 14 hour period - again, not using it at all, and with rapid start disabled.

I was surprised that it went down this much. Not sure if it's just reporting that could be off, that a battery naturally loses this much life over 14 hours doing nothing or "vampire" energy use, that is, the laptop still sucks juice even when it's doing nothing because some circuit still has electricity, maybe even a battery power sensor?

Btw, also timed my boot time. It was about 4 seconds to the boot manager and after that 10 seconds to the Manjaro login screen.
* Zorin OS 17.1 Core and Windows 11 Pro on a Dell Precision 3630 Tower with an
i5-8600 3.1 GHz 6-core processor, dual 22" displays, 16 GB of RAM, 512 GB Nvme and a Geforce 1060 6 GB card
* Motorola Edge (2022) phone with Android 13

Jason

#17
I just surprised myself by actually timing how long it takes my tablet and phone to start from being powered down. It's not as bad as I thought - 27 seconds for the tablet and and 35 seconds for the phone. I'm definitely going to power down my tablet at night for now on and going to try powering down my tablet when not in use and see if I can handle the delay.

It's interesting in our culture that doesn't like to wait for our electronics so much that even 30-35 seconds seems like too huge a delay. I mean there are lots of other times in our life when we have to wait longer than that for pretty much anything and it doesn't bother us. When I get a donut at Timmy's, it probably takes a minute or more! :) I usually have to wait 10-15 minutes for my dentist though usually that's because I'm early. Even my tea can take 2-3 minutes (guessing) for the kettle to boil! We're spoiled with electronics.
* Zorin OS 17.1 Core and Windows 11 Pro on a Dell Precision 3630 Tower with an
i5-8600 3.1 GHz 6-core processor, dual 22" displays, 16 GB of RAM, 512 GB Nvme and a Geforce 1060 6 GB card
* Motorola Edge (2022) phone with Android 13

buster

"to wait for our electronics so much that even 30-35 seconds seems like too huge a delay. "

I agree with your sentiments 100% Jason. Much of life is waiting. Try driving. Or watching a sporting event, or cooking, or getting the plumbing fixed...... But for some reason electronics are seen differently, and judged differently.

"And coming out of a hibernation isn't fast (it may or may not be faster than booting depending on what you were working on). "

This is what my understanding is. My understanding is that it is a reboot, but it pulls up the computer into its previous state. I just thought the word hibernate was being misused for something like a deep sleep.
Growing up from childhood and becoming an adult is highly overrated.

fox

Quote from: Jason Wallwork on December 31, 2018, 09:29:39 PM
....
It's interesting in our culture that doesn't like to wait for our electronics so much that even 30-35 seconds seems like too huge a delay. I mean there are lots of other times in our life when we have to wait longer than that for pretty much anything and it doesn't bother us. ....
I think that part of the reason is that "we" (some of us? many of us?) use electronic devices like phones and tablets differently than we use other devices or services. With my tablet or phone, I often access it for less than a minute, to check the weather, check email, send a text or find an address. Once I have performed the function, I put the device back on standby. It seems like a long time to wait 30 sec or so to start up a device just to use it for a minute.

A TV or radio is different. If I turn it on, I'm using it for a lot longer period. I don't have my TV set for instant on; it doesn't bother me to wait the few extra seconds for it to power up, knowing I'm going to be using it for awhile. A car is different in the same way. I used to warm it up for a few minutes because it was supposed to be good for the engine. The extra time bothered me a lot less than waiting 30 sec or more for a computer or tablet to boot up, knowing I would be using the car for a lot longer. So I'm thinking of proposing "Fox's Rule": the amount of time a person will accept a delay in the startup of a device is related (though not linearly) to the amount of time the device will be used.
Ubuntu 23.10 on 2019 5k iMac
Ubuntu 22.04 on Dell XPS 13

fox

Quote from: Jason Wallwork on December 31, 2018, 09:17:16 PM
....
Btw, also timed my boot time. It was about 4 seconds to the boot manager and after that 10 seconds to the Manjaro login screen.
The real question, though, is how long it takes to get to a working desktop. I timed startup on Ubuntu and MX; they weren't that different. It took 7 seconds to the grub menu (I'm using grub-customizer), then 22 seconds to the login screen. Total elapsed time to a working desktop was 38-45 seconds. Coming out of hibernation, it took 8 seconds to log back in to a desktop.
Ubuntu 23.10 on 2019 5k iMac
Ubuntu 22.04 on Dell XPS 13

Jason

#21
I think maybe it was about 5 seconds from login to a working desktop. I was using the light version of Manjaro with XFCE though, so probably about 20 seconds in total. I will check it again later to make sure.

If it only took you 8 seconds to get back to a desktop, you most definitely weren't in hibernation mode even if that was the setting you chose on shutdown. It's not fast. Must have been in sleep or what they call deep sleep. Now maybe there is form of hibernate that is newer than the one I'm familiar with that somehow does that. It would have to be like suspend in that it keeps power to the RAM and stores at least the OS in RAM, then it just has to load the stuff you were working on into RAM from the disk. That would be considerably faster. I think that is what the S4 power mode describes.


In any case, I get not powering down the tablet entirely when you might just use it for a short task like checking the weather or dashing off an email. But if you have a tablet for that, then you really don't need to power up your laptop quickly so you can do it, right?

Curiously, I found out that I can't do hibernate on my desktop system. The option isn't available in Windows or Linux (Kubuntu). Not sure why. Checked the EUFI and there is no mention of hibernation anywhere other than mentioning that you can choose to have S4 (which is hibernate) mode (and S3 alternatively) actually go to S2 mode. At least that's what I think it meant.
* Zorin OS 17.1 Core and Windows 11 Pro on a Dell Precision 3630 Tower with an
i5-8600 3.1 GHz 6-core processor, dual 22" displays, 16 GB of RAM, 512 GB Nvme and a Geforce 1060 6 GB card
* Motorola Edge (2022) phone with Android 13

Jason

Heck, I went ahead and checked it again now. I wasn't using a stopwatch before so tried it with that this time.

5 seconds to Grub menu
12 seconds to login screen
8 seconds after login to full working desktop
25 seconds total


I just used the hibernate option in the shutdown for Manjaro XFCE (and using an SSD drive) and it took about 17 seconds just to go into hibernate and then 22 seconds to come back out of it. That's pretty standard for hibernate in that it will take close to the amount of time to start a system from full shutdown to resume. I could even say it taking longer if you had a lot on your desktop at the time. It may take more time to read it from the disk than it would just to start the OS with nothing else running. Off course if you add the shutdown time, then it's really not fast.

Maybe I'll give MX Linux a try later and see what results I get with that to compare with yours.


* Zorin OS 17.1 Core and Windows 11 Pro on a Dell Precision 3630 Tower with an
i5-8600 3.1 GHz 6-core processor, dual 22" displays, 16 GB of RAM, 512 GB Nvme and a Geforce 1060 6 GB card
* Motorola Edge (2022) phone with Android 13

fox

Well whatever my laptops are doing, the wake-up is nearly instantaneous. If it took me 17 sec to go into hibernate and 22 to come back, I would have no interest in this as a regular option to keep a laptop on standby. So what are my laptops doing?

I also realized that when I put a laptop in regular standby mode for a long period of time (typically a day or more), I don't care about saving something I'm working on. I have already quit any application I was running, and just use this to save the trouble of waiting the 35 sec or so for boot-up. Pretty much the same as a tablet, although in a tablet I often keep something I'm reading in the background. Would "suspend" do this for me in low power mode?

What I've been doing with the laptop is relatively recent. My 2015 Dell xps spent most of its time just sitting unused when I wasn't traveling. With a small form-factor (a 13" laptop in an 11" body), I decided to move it to my bedroom night table. I use it for anywhere from 5 minutes to an hour at night before going to bed, checking mail, weather, reading stuff. Then I close the lid and usually don't come back to it until the next evening. And yes, I could do this on a tablet. But I find it a lot easier to read stuff on a 13" screen than an 8". But you're right, I could do all this on my tablet and just leave the laptop for more extended use.



Ubuntu 23.10 on 2019 5k iMac
Ubuntu 22.04 on Dell XPS 13

Jason

#24
I mean, it makes sense to have it come back to life fast. The convenience is nice. I totally agree on leaving tablets on most of the time but turning them off at night, meaning when you go to bed or are fairly sure you won't be using them for 8 hours or more makes a lot of sense unless you're really rushed in the morning, I suppose.

I can't really see any reason, personally for leaving laptops or even desktops on standby/suspend, at least not if you're going to be away from the computer for say, an hour. It's like leaving a car idling for a minute or more - no, not as bad, but we're doing it for the convenience, not because we really have to. Having said that, it's better to have it going into suspend then just staying on full power all the time.

Phones are meant to stay on all the time, at least for use as phones, even at night I want somebody to be able to reach me in an emergency or to use it an emergency. But I noticed my phone has an "Ultra-Stamina" mode that basically turns off wireless/data and all apps but the core apps - phone, contacts, messaging, camera, album, calendar, clock, calculator, FM radio and settings. So I've started using that when I got to bed.

The other way to look at it even if we're not concerned that much about power use is that the last your battery is used, the longer it will last and therefore your device, especially if you can't replace the battery easily or it's just not worth it. I had a laptop that cost $200 once; it didn't seem worth getting spending $80 on a battery to extend it's life. Good thing, too, in its case as it burned out probably a year later.

One potential downside to not leaving your devices on is that they can't update automatically. With Windows this can be a huge PITA but at least know when the updates are coming. Linux updates don't get in the way, I find and Android apps on recent devices don't seem to. I mean, I can do updating and continue using the device. With Windows, forget it. But older Android devices I find are slow as molasses when you try to do anything else but updating.

Speaking of the devil, tried booting up Windows from total shutdown, it was a full minute to the desktop. Ugh. And that's why Rapid Start is an option. But if you're using it constantly, not switching to Linux, it's faster booting the second time even without Rapid Start. It seems to be using hibernate as default thought it never says so except buried in the power settings. Restarting back into Windows after coming out of it was about 30 or so seconds to the desktop.
* Zorin OS 17.1 Core and Windows 11 Pro on a Dell Precision 3630 Tower with an
i5-8600 3.1 GHz 6-core processor, dual 22" displays, 16 GB of RAM, 512 GB Nvme and a Geforce 1060 6 GB card
* Motorola Edge (2022) phone with Android 13

fox

Quote from: Jason Wallwork on January 02, 2019, 07:30:49 AM
.... But I noticed my phone has an "Ultra-Stamina" mode that basically turns off wireless/data and all apps but the core apps - phone, contacts, messaging, camera, album, calendar, clock, calculator, FM radio and settings. So I've started using that when I got to bed.
Tell me more about this Ultra-Stamina mode. How do I get that on my Android phone?

Your point about battery wear is an excellent one; one that I hadn't thought of. And it isn't just adding wear to the battery, but also as the battery wears but is still good, capacity goes down so you get shorter battery time. That really irritates me when it happens. My very old Acer ULV laptop went from 6 hours of battery life when I replaced the battery, to about 2 or 2 1/2 now. I don't use it anymore, but that battery drop hastened my loss of interest in it.
Ubuntu 23.10 on 2019 5k iMac
Ubuntu 22.04 on Dell XPS 13

Jason

Quote from: fox on January 02, 2019, 10:43:41 AM
Tell me more about this Ultra-Stamina mode. How do I get that on my Android phone?


It's something Sony added to my phone. It's under battery - if your phone/tablet has a similar feature, you'll probably find it under there, too. There may be an app that does the equivalent, a search for an app that is like it shows up this:

https://www.quora.com/Are-there-any-apps-similar-to-Sonys-battery-saving-mode-including-the-stamina-mode-for-Android-phones-in-general

You'd probably have to root your phone to get maximum benefit from it.
* Zorin OS 17.1 Core and Windows 11 Pro on a Dell Precision 3630 Tower with an
i5-8600 3.1 GHz 6-core processor, dual 22" displays, 16 GB of RAM, 512 GB Nvme and a Geforce 1060 6 GB card
* Motorola Edge (2022) phone with Android 13

fox

I did a quick check on battery loss with suspend in Ubuntu. I know it was using suspend because it shows up as an option. Definitely worse than whatever mode was being used before, as the loss was about 8% in an hour. The drop I get with typical active use is only 12%/hr!

In the end, all this testing is interesting but moot, as I'll end up shutting down the laptop between uses - as a result of this very helpful discussion.
Ubuntu 23.10 on 2019 5k iMac
Ubuntu 22.04 on Dell XPS 13

Jason

I found it interesting, as well. Thanks for sharing your experiences.
* Zorin OS 17.1 Core and Windows 11 Pro on a Dell Precision 3630 Tower with an
i5-8600 3.1 GHz 6-core processor, dual 22" displays, 16 GB of RAM, 512 GB Nvme and a Geforce 1060 6 GB card
* Motorola Edge (2022) phone with Android 13

fox

A quick energy use calculation relevant to hibernation. Assuming that keeping your laptop on standby costs 10% of your battery life per day (this is more or less what I have been doing), you will use 36.5 battery cycles per year. (A cycle being 100% of battery recharge capacity.) At that rate, you will use 183 cycles in 5 years. With a typical Li-ion battery giving 500 cycles of use, you will be using about 35% of your battery cycles over that period from just hibernation alone. The effects of this are not only to reduce the lifetime of the battery, but also, the amount of battery time your laptop has along the way. Even if you used your laptop only an hour a day and that hour used 15% of battery life (applies to a laptop that can last about 6 1/2 hours per charge), this now adds 275 cycles in 5 years. Add the hibernation and use costs together and you have a battery with 460 of its 500 cycles gone after 5 years. In other words, a battery that needs to be replaced. Actually, under these assumptions, most people would probably want to replace the battery at least a year sooner as by this point, battery life would have been reduced to 1/3 of what it was when you bought the laptop!

This is based on a lot of assumptions used and postage-stamp calculations based linear functions. The only laptops I have owned for anywhere this long are an 11" Acer Aspire ULV and a 2013 13" MacBook Air. The MacBook Air was rarely hibernated. I kept it in my office and turned it on and off between uses (mainly lectures and presentations). I'm sure that battery time dropped over the years, but not to the point that I ever considered replacing the battery. The Acer fared much worse, in part because the original battery capacity was lower and in part, I'm sure, because I kept it hibernating between uses. I think it's about 6 years old and battery time is down to 2 or 2 1/2 hours. If I were keeping it I would replace its battery for sure.
Ubuntu 23.10 on 2019 5k iMac
Ubuntu 22.04 on Dell XPS 13