之前没注意,昨天发现一晚上 mbp m1 待机耗了 10% 的电。pmset -g stats
查到了数百个唤醒。
TL;DR 执行
sudo pmset -b powernap 0
后一晚还是 100%
研究了好一会,发现系统的一个巨坑,是这样:
执行 pmset -g custom
查看电源设置,可以看到 powernap
始终是打开的。在 x86 尝试后发现这个就是「电池小憩」,而 womp
才是 「唤醒以供网络访问」。
所以找到元凶了,一行命令干掉它:sudo pmset -b powernap 0
- 在电池供电下关闭小憩
如果还不满意可以执行 sudo pmset -b tcpkeepalive 0
- 彻底干掉网络,但是 find my mac 也失效了。
给个对照:
最后看一下两个版本描述的区别( m1 是 mac13 ,x86 是黑苹果 mac12 ):
1
zhaoxin 2023-03-14 18:20:21 +08:00
我是 Mac mini ,关了小憩,没关网络。因为网络开着,手机可以访问已经睡眠的 Mac mini 的共享文件夹,所以这个还是有必要开的。当然如果你的 Mac 没有开任何共享服务(文件共享,远程桌面),那么直接关了也无妨。
|
2
luistrong 2023-03-14 19:48:49 +08:00
感觉插电情况下 powernap 也没啥打开的必要性吧
|
3
6david9 2023-03-14 20:00:01 +08:00 via Android
我的电脑开了 clash for Windows 会组织睡眠。还有 vs code 也会影响休眠。你下次睡眠前检查下有没有类似 APP 在运行。
|
4
Chenhe OP @zhaoxin 我觉得网络不必关。现在这样已经几乎不耗电了。而且关闭网络的时候系统会给出警告,说会影响一些核心功能。以后用到的时候就给自己挖坑了。
|
6
Chenhe OP @6david9 查了日志,没见有第三方应用的痕迹。而且阻止休眠的耗电会特别明显,定时唤醒的耗电没有那么夸张,还是可以区分开的。比如 powenap 一夜 10%,看到一些人反映程序阻止休眠的,一夜 30%
|
7
Chenhe OP @luistrong 抱歉 没看清楚。插电时候功耗就无所谓了,可以定期更新打开就是最新状态还不错。反正开着也无妨
|
8
Vcccc 2023-03-14 23:12:52 +08:00
我也试试,之前黑屏状态下,疯狂掉电,一晚上 30 以上,打电话给客服也没说出个所以然。以为是升级系统的问题,还特意降到了 12.6.2 的版本,结果还是一样,一直没找到原因,感谢!
|
9
eunrui 2023-03-15 09:37:33 +08:00
|
10
magichacker 2023-03-15 14:09:29 +08:00
大佬,我 2020 款的 MBP 13 寸,系统版本 12.6.3 。今年开始疯狂自动重启,尤其是半天不用就自动重启,关机过一会儿也自动重启了,touch bar 经常性疯狂闪烁,有时候 touch bar 直接不亮了,按照官网给的检测方案也没测出什么问题,去天才吧也没检测出什么问题。以前电脑正常的时期,我是一直插着电扣着电脑连接显示器的使用方式。第一次发现的时候电脑已经升级到了 big sur 版本,以为是系统问题,苹果推出新版本就升级也没有解决问题,后来回退到 catelina 也不行。大佬有了解过这种情况吗?
|
11
Chenhe OP @eunrui `spu_queue_overflow_ep42 ` 1-2 小时一次是正常的。我感觉 nide 问题不在唤醒,而是 standby 。你把它关了意味着禁止系统从睡眠切换到休眠(把内存写入硬盘,并切断内存断电)也就说你的内存彻夜供电。
试试看执行 sudo pmset -b standby 1 |
12
Chenhe OP @magichacker 你这太复杂了,怎么看都像是故障。可以先 `last | grep -e reboot -e shutdown` 看一下重启与关机记录。更详细原因怕是看自己扒日志了
也可以执行 pmset -g sched 看看是不是有设置定时开机 |
13
eunrui 2023-03-15 16:36:18 +08:00
@Chenhe 可以睡,就是总被唤醒,真的无语,而且我发现休眠的时候,在地铁上打开耳机也可以唤醒电脑,13 之后也没有关闭蓝牙唤醒的入口了
2023-03-14 20:41:26 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=disabled Using Batt (Charge:80%) 5623 secs 2023-03-14 22:15:09 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to AOP.OutboxNotEmpty spu_queue_overflow_ep42/ Using BATT (Charge:80%) 45 secs 2023-03-14 22:15:54 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=disabled Using Batt (Charge:80%) 5610 secs 2023-03-14 23:49:24 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to AOP.OutboxNotEmpty spu_queue_overflow_ep42/ Using BATT (Charge:80%) 45 secs 2023-03-14 23:50:09 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=disabled Using Batt (Charge:79%) 5663 secs 2023-03-15 01:24:32 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to AOP.OutboxNotEmpty spu_queue_overflow_ep42/ Using BATT (Charge:79%) 45 secs 2023-03-15 01:25:17 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=disabled Using Batt (Charge:77%) 5670 secs 2023-03-15 02:59:47 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to AOP.OutboxNotEmpty spu_queue_overflow_ep42/ Using BATT (Charge:77%) 45 secs 2023-03-15 03:00:32 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=disabled Using Batt (Charge:75%) 2932 secs 2023-03-15 03:49:24 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to NUB.SPMISw3IRQ nub-spmi0.0x02 rtc/Maintenance Using BATT (Charge:75%) 45 secs 2023-03-15 03:50:09 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=disabled Using Batt (Charge:74%) 5680 secs 2023-03-15 05:24:49 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to AOP.OutboxNotEmpty spu_queue_overflow_ep42/ Using BATT (Charge:74%) 45 secs 2023-03-15 05:25:34 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=disabled Using Batt (Charge:73%) 5670 secs 2023-03-15 07:00:04 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to AOP.OutboxNotEmpty spu_queue_overflow_ep42/ Using BATT (Charge:73%) 43 secs 2023-03-15 07:00:47 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=disabled Using Batt (Charge:71%) 3166 secs 2023-03-15 07:53:33 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to SMC.OutboxNotEmpty smc.70070000 wifibt wlan/ Using BATT (Charge:71%) 45 secs 2023-03-15 07:54:18 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=disabled Using Batt (Charge:70%) 758 secs |
15
dhou45 2023-03-15 22:32:16 +08:00
谢谢楼主解答了我长久以来的这个小困惑. 之前就发现 Intel 的老 Mac 晚上待机基本不掉电, 换了 M1 的 MBP 和 M2 的 MBA 之后都有 3%-5%的待机耗电.
|
17
a66243766 2023-03-16 00:21:46 +08:00
@eunrui
I:due to SMC.OutboxNotEmpty smc.70070000 wifibt wlan WLC_E_TKO ARPT/ Using AC II:due to AOP.OutboxNotEmpty spu_queue_overflow_ep42/ Using BATT 主要是就是这两个 我测试过,我的插排有远程开关,晚上睡觉的时候会把总闸关闭,这时电脑是断电的,然后我合并笔记本盖子 这时候电脑接着显示器的 A:视频线( dp1.4 to c ),B:拓展坞(贝尔金),C:充电器磁吸插头 magicsafe3 ,D:蓝牙无线网开启 情境一:ABCD 全连着 I 和 II 都存在,一晚上掉电 15% 情境二:ACD 全连着 I 和 II 都存在,一晚上掉电 12% 情境三:CD 全连着 I 大量存在( 280s/darwake ),II 少量存在,一晚上掉电 10% 情境四:ABD 全连着 I 少量存在,II 少量存在,一晚上掉电 5% 情境五:C 连着 I 大量存在( 280s/darwake ),II 少量存在,一晚上掉电 9% 情境六:D 连着 I 不存在,II 少量存在( 5660s/darwake ),一晚上掉电 2% 情境六:全不连着,II 少量存在( 5660s/darwake ),一晚上掉电 2% 我的综上:这样我还设置远程总闸干啥?我弄的目的就是为了一键可以关闭插排的电源然电脑 /显示器全部断电,这样电脑只需要盒盖就行,但是当充电器磁吸插头 magicsafe3 断电源连在本子上的时候会产生大量 I ( 280s/darwake ),这样我必须把连接的设备全部拔掉,设置总闸当初就是以为外设不通电就不会产生 io ,实际上设置总闸没有意义,电源断掉了,还是要拔掉线才行,最大的疑问就是《当充电器磁吸插头 magicsafe3 断电源连在本子上的时候会产生大量 I ( 280s/darwake )》。 不知道你们看到这个 testdata 有什么总结? |
18
a66243766 2023-03-16 00:39:12 +08:00
|
19
a66243766 2023-03-16 00:52:09 +08:00
另外纠正下 standby 和 hibernatemode op 好像理解错了,只有 hibernatemode 25 时候才会写入硬盘内存断电,硬盘休眠
STANDBY ARGUMENTS standby causes kernel power management to automatically hibernate a machine after it has slept for a specified time period. This saves power while asleep. This setting defaults to ON for supported hardware. The setting standby will be visible in pmset -g if the feature is supported on this machine. standbydelayhigh and standbydelaylow specify the delay, in seconds, before writing the hibernation image to disk and powering off memory for Standby. standbydelayhigh is used when the remaining battery capacity is above highstandbythreshold , and standbydelaylow is used when the remaining battery capacity is below highstandbythreshold. highstandbythreshold has a default value of 50 percent. autopoweroff is enabled by default on supported platforms as an implementation of Lot 6 to the European Energy-related Products Directive. After sleeping for <autopoweroffdelay> seconds, the system will write a hibernation image and go into a lower power chipset sleep. Wakeups from this state will take longer than wakeups from regular sleep. autopoweroffdelay specifies the delay, in seconds, before entering autopoweroff mode. 但是 arm 之后 standbydelayhigh standbydelaylow 又不支持设置,这个 m1 的电脑真的是一地稀碎 |
20
Chenhe OP @a66243766 我的理解是:
- hibernatemode 控制宏观的待机模式,25 强制写硬盘,3 混合。 - standby 在 hibernatemode=0/3 的情况下进一步控制具体是否允许 /何时写入硬盘 尽管理论上 hibernatemode=0 应该是永不写入,但是 man pmset 里有这么一句话: Whether or not a hibernation image gets written is also dependent on the values of standby and autopoweroff. To disable hibernation images completely, ensure hibernatemode standby and autopoweroff are all set to 0. 虽然 standby 没有明确说会断电,但它讲「 This saves power while asleep 」,显然只写硬盘是不会省电的,除非关闭内存。 |
22
a66243766 2023-03-16 10:18:31 +08:00
@Chenhe 这是我昨天把插排电源关闭,只连着显示器的 db2c 蓝牙关闭 ,磁吸口拔掉,拓展坞拔掉,后的结果
2023-03-16 00:56:19 +0800 Sleep Entering Sleep state due to 'Clamshell Sleep':TCPKeepAlive=active Using Batt (Charge:83%) 5677 secs 2023-03-16 02:30:56 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to AOP.OutboxNotEmpty spu_queue_overflow_ep42/ Using BATT (Charge:83%) 38 secs 2023-03-16 02:31:34 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=active Using Batt (Charge:83%) 5665 secs 2023-03-16 04:05:59 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to AOP.OutboxNotEmpty spu_queue_overflow_ep42/ Using BATT (Charge:83%) 10 secs 2023-03-16 04:06:09 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=active Using Batt (Charge:82%) 5676 secs 2023-03-16 05:40:45 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to AOP.OutboxNotEmpty spu_queue_overflow_ep42/ Using BATT (Charge:82%) 12 secs 2023-03-16 05:40:57 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=active Using Batt (Charge:81%) 1550 secs 2023-03-16 06:06:47 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to NUB.SPMISw3IRQ nub-spmi0.0x02 rtc/Maintenance Using BATT (Charge:81%) 8 secs 2023-03-16 06:06:55 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=active Using Batt (Charge:81%) 5661 secs 2023-03-16 07:41:16 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to AOP.OutboxNotEmpty spu_queue_overflow_ep42/ Using BATT (Charge:81%) 13 secs 2023-03-16 07:41:29 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=active Using Batt (Charge:80%) 5667 secs 2023-03-16 09:15:56 +0800 DarkWake DarkWake from Deep Idle [CDN] : due to AOP.OutboxNotEmpty spu_queue_overflow_ep42/ Using BATT (Charge:80%) 15 secs 2023-03-16 09:16:11 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=active Using Batt (Charge:79%) 3182 secs 2023-03-16 10:09:13 +0800 Wake Wake from Deep Idle [CDNVA] : due to SMC.OutboxNotEmpty smc.70070000 lid/HID Activity Using BATT (Charge:79% |
23
magichacker 2023-03-16 14:32:00 +08:00
@Chenhe 好的。我晚上回去试试看。多谢
|
24
kir4 2023-04-06 17:02:41 +08:00
插电的情况下,是不是把 hibernatemode 改成 0 ,standby 改成 0 ,更好
|