Raspbian上snapd狂吃CPU问题
To get rid of snapd on Raspbian/RaspberryPi OS Buster, since it eats lots of cpu power, especially on the old hardware, like a Pi 2B.
一台年迈的Pi 2B,运行着时时更新的Raspbian Buster,兢兢业业给娃做文件服务器,不亦乐乎。
一天apt dist-upgrade之后,就发现system load频繁升高,系统空载就能吃掉大致一个核的性能。top后画风大致是这样的。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
➜ ~ top top - 22:26:04 up 2 days, 13:44, 3 users, load average: 0.96, 0.99, 0.93 Tasks: 143 total, 1 running, 142 sleeping, 0 stopped, 0 zombie %Cpu(s): 8.4 us, 2.7 sy, 0.0 ni, 82.4 id, 6.3 wa, 0.0 hi, 0.2 si, 0.0 st MiB Mem : 926.1 total, 222.2 free, 171.1 used, 532.7 buff/cache MiB Swap: 100.0 total, 100.0 free, 0.0 used. 693.0 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 345 root 20 0 968804 21248 13064 S 37.3 2.2 1065:41 snapd 84 root 20 0 0 0 0 S 1.0 0.0 28:27.25 jbd2/mmcblk0p2- 15049 pi 20 0 10440 3096 2540 R 1.0 0.3 0:00.09 top 346 root 20 0 2968 2060 1564 S 0.7 0.2 2:17.19 dhcpcd 17101 root 0 -20 0 0 0 I 0.7 0.0 2:49.94 kworker/0:1H-mmc_complete 10 root 20 0 0 0 0 I 0.3 0.0 7:00.05 rcu_sched 18 root 0 -20 0 0 0 I 0.3 0.0 4:21.89 kworker/1:0H-kblockd 83 root 0 -20 0 0 0 I 0.3 0.0 4:24.37 kworker/2:1H-kblockd 412 root 20 0 31976 9496 8068 S 0.3 1.0 0:29.19 nmbd |
于是很想了解这货在干嘛,消耗这么多脑力,思考人生么?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
➜ ~ sudo lsof -p 345 lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs Output information may be incomplete. COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME snapd 345 root cwd DIR 179,2 4096 2 / snapd 345 root rtd DIR 179,2 4096 2 / snapd 345 root txt REG 7,0 13421332 7147 /snap/core/9291/usr/lib/snapd/snapd snapd 345 root mem REG 179,2 1296004 2022 /lib/arm-linux-gnueabihf/libc-2.28.so snapd 345 root mem REG 179,2 130416 2085 /lib/arm-linux-gnueabihf/libpthread-2.28.so snapd 345 root mem REG 179,2 17708 10917 /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so snapd 345 root mem REG 179,2 138604 1945 /lib/arm-linux-gnueabihf/ld-2.28.so snapd 345 root 0r CHR 1,3 0t0 1028 /dev/null snapd 345 root 1u unix 0xf31a5a4c 0t0 14576 type=STREAM snapd 345 root 2u unix 0xf31a5a4c 0t0 14576 type=STREAM snapd 345 root 3u IPv4 152109 0t0 TCP 192.168.50.127:48604->api.snapcraft.io:https (ESTABLISHED) snapd 345 root 4u IPv4 233503 0t0 TCP 192.168.50.127:40786->api.snapcraft.io:https (ESTABLISHED) snapd 345 root 6u a_inode 0,11 0 5804 [eventpoll] snapd 345 root 7u unix 0x5b752603 0t0 14350 /run/snapd.socket type=STREAM snapd 345 root 8u unix 0xfebd686d 0t0 14353 /run/snapd-snap.socket type=STREAM snapd 345 root 9u REG 179,2 0 386387 /var/lib/snapd/snaps/core_9668.snap.partial snapd 345 root 12u netlink 0t0 18728 KOBJECT_UEVENT snapd 345 root 13r FIFO 0,10 0t0 18729 pipe snapd 345 root 14w FIFO 0,10 0t0 18729 pipe |
看起来是想回家拉点什么私货回来(api.snapcraft.io),但还是搞不懂,走io就走io,连续几天24小时一直吃那么多cpu是什么鬼?
完整阅读本篇»