{"id":10703,"date":"2011-05-10T07:00:00","date_gmt":"2011-05-10T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2011\/05\/10\/why-is-hybrid-sleep-off-by-default-on-laptops-and-how-do-i-turn-it-on\/"},"modified":"2011-05-10T07:00:00","modified_gmt":"2011-05-10T07:00:00","slug":"why-is-hybrid-sleep-off-by-default-on-laptops-and-how-do-i-turn-it-on","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20110510-00\/?p=10703","title":{"rendered":"Why is hybrid sleep off by default on laptops? (and how do I turn it on?)"},"content":{"rendered":"<p>\n<i>Hybrid sleep<\/i>\nis a type of sleep state that combines\n<i>sleep<\/i> and <i>hibernate<\/i>.\nWhen you put the computer into a hybrid sleep state,\nit writes out all its RAM to the hard drive\n(just like a hibernate),\nand then goes into a low power state that keeps RAM refreshed\n(just like a sleep).\nThe idea is that you can resume the computer quickly from sleep,\nbut if there is a power failure or some other catastrophe,\nyou can still restore the computer from hibernation.\n<\/p>\n<p>\nA hybrid sleep can be converted to a hibernation by simply\nturning off the power.\nBy comparison, a normal sleep requires resuming the computer\nto full power in order to write out the hibernation file.\nBack in the Windows&nbsp;XP days,\nI would sometimes\nsee the computer in the next room spontaneously\nturn itself on:\nI&#8217;m startled at first, but then I see on the screen that\nthe system is hibernating, and I understand what&#8217;s going on.\n<\/p>\n<p>\nHybrid sleep is on by default for desktop systems\nbut off by default on laptops.\nWhy this choice?\n<\/p>\n<p>\nFirst of all, desktops are at higher risk of the power outage\nscenario wherein a loss of power (either due to a genuine\npower outage or simply unplugging the computer by mistake)\ncauses all work in progress to be lost.\nDesktop computers typically don&#8217;t have a backup battery,\nso a loss of power means instant loss of sleep state.\nBy comparison, laptop computers have a battery which can\nbridge across power outages.\n<\/p>\n<p>\nFurthermore, laptops have a safety against battery drain:\nWhen battery power gets dangerously low,\nit can perform an\n<a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2009\/07\/03\/9815394.aspx\">\nemergency hibernate<\/a>.\n<\/p>\n<p>\nLaptop manufacturers also requested that hybrid sleep be off\nby default.\nThey didn&#8217;t want the hard drive to be active for a long time\nwhile the system is suspending,\nbecause when users suspend a laptop, it&#8217;s often in the form of\n&#8220;Close the lid, pick up the laptop from the desk,\nthrow it into a bag, head out.&#8221;\nPerforming large quantities of disk I\/O at a moment when the\ncomputer is physically being jostled around increases the risk\nthat one of those I\/O&#8217;s will go bad.\nThis pattern doesn&#8217;t exist for desktops: When you suspend a desktop\ncomputer, you just leave it there and let it do its thing.\n<\/p>\n<p>\nOf course, you can override this default easily from the Control Panel.\nUnder <i>Power Options<\/i>, select\n<i>Change plan settings<\/i>,\nthen\n<i>Changed advanced power settings<\/i>,\nand wander over into the <i>Sleep<\/i> section of the configuration tree.\n<\/p>\n<p>\nIf you&#8217;re a command line sort of person,\nyou can use this insanely geeky command line to enable hybrid\nsleep when running on AC power in Balanced mode:\n<\/p>\n<pre>\npowercfg -setacvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e\n                          238c9fa8-0aad-41ed-83f4-97be242c8f20\n                          94ac6d29-73ce-41a6-809f-6363ba21b47e 1\n<\/pre>\n<p>\n(All one line. Take a deep breath.)\n[<b>Update<\/b>: Or you can use\n<code>powercfg -setacvalueindex SCHEME_BALANCED SUB_SLEEP HYBRIDSLEEP 1<\/code>,\nas pointed out by\n<a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2011\/05\/10\/10162728.aspx#10163383\">\nRandom832<\/a>.\nI missed this because the ability to substitute aliases is not mentioned\nin the <code>-setacvalueindex<\/code> documentation.\nYou have to\n<a HREF=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2011\/05\/10\/10162728.aspx#10163444\">\ndig into the <code>-aliases<\/code> documentation<\/a> to find it.]\n<\/p>\n<p>\nOkay, what do all these insane options mean?\n<\/p>\n<p>\n<code>-setacvalueindex<\/code> sets the behavior when running on AC power.\nTo change the behavior when running on battery, use\n<code>-setdcvalueindex<\/code> instead.\nOkay, that was easy.\n<\/p>\n<p>\nThe next part is a GUID, specifically, the GUID that represents\nthe balanced power scheme.\nIf you want to modify the setting for a different power scheme,\nthen substitute that scheme&#8217;s GUID.\n<\/p>\n<p>\nAfter the scheme GUID comes the subgroup GUID.\nHere, we give the GUID for the Sleep subgroup.\n<\/p>\n<p>\nNext we have the GUID for the Hybrid Sleep setting.\n<\/p>\n<p>\nFinally, we have the desired new value for the setting.\nAs you might expect, 1 enables it and 0 disables it.\n<\/p>\n<p>\nAnd where did these magic GUIDs come from?\nRun the <code>powercfg -aliases<\/code> command to see all the GUIDs.\nYou can also run <code>powercfg -q<\/code> to view all the settings\nand their current values in the current power scheme.\n<\/p>\n<p>\n<b>Bonus reading<\/b>:\n<\/p>\n<ul>\n<li>\n    <a HREF=\"http:\/\/windowsteamblog.com\/blogs\/windowsvista\/archive\/2006\/12\/08\/windows-vista-power-management.aspx\">\n    Windows Vista Power Management<\/a><\/p>\n<li>\n    <a HREF=\"http:\/\/blogs.technet.com\/robert_hensing\/archive\/2007\/08\/05\/hybrid-sleep-in-vista-and-s0-s5-explained.aspx\">\n    Hybrid sleep in Vista and S0 &#8211; S5 explained<\/a>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Hybrid sleep is a type of sleep state that combines sleep and hibernate. When you put the computer into a hybrid sleep state, it writes out all its RAM to the hard drive (just like a hibernate), and then goes into a low power state that keeps RAM refreshed (just like a sleep). The idea [&hellip;]<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[2,104],"class_list":["post-10703","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>Hybrid sleep is a type of sleep state that combines sleep and hibernate. When you put the computer into a hybrid sleep state, it writes out all its RAM to the hard drive (just like a hibernate), and then goes into a low power state that keeps RAM refreshed (just like a sleep). The idea [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/10703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=10703"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/10703\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=10703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=10703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=10703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}