将我的 Raspberry Pi 4 8GB 从 Ubuntu 21.04 升级到 21.10 后,由于 systemd-udevd,我的负载很高。我全新安装了 Ubuntu 服务器 21.10,但问题仍然存在。我使用 SSD(无 SD 卡)。启动时看起来不错,但大约一天后,负载超过 25,其中大部分似乎是由于 >15 个 systemd-udevd 进程造成的。我运行了一个小型 MicroK8s 和 MySQL 服务器安装,我认为负载与它们无关。升级前,负载稳定在 4 左右。
以下是命令打印输出的示例top
:
2253733 mysql 20 0 2792212 436376 32344 S 71.0 5.5 661:02.75 mysqld
2218900 root 20 0 9100 716 0 R 66.8 0.0 920:43.38 apiservice-kick
780593 root 20 0 3545776 775276 104908 S 63.2 9.7 1076:01 kubelite
802755 root 20 0 761976 46732 34148 S 13.0 0.6 0:00.40 calico-node
910416 root 20 0 23240 2948 0 R 12.7 0.0 193:44.68 systemd-udevd
926403 root 20 0 23240 2948 0 R 10.7 0.0 192:11.89 systemd-udevd
746105 root 20 0 265968 39976 9208 S 10.1 0.5 2:19.20 flask
411700 root 20 0 31172 10920 0 R 9.8 0.1 287:25.06 systemd-udevd
1698353 root 20 0 23240 2948 0 R 8.8 0.0 142:39.40 systemd-udevd
958 root 20 0 145596 126728 3708 R 8.1 1.6 82:53.44 systemd-udevd
1141818 root 20 0 23240 2948 0 R 7.5 0.0 175:48.13 systemd-udevd
755129 root 20 0 22708 2488 0 R 7.2 0.0 214:38.38 systemd-udevd
2919424 root 20 0 23240 2936 0 R 6.5 0.0 85:49.04 systemd-udevd
1258055 root 20 0 23240 2948 0 R 6.2 0.0 168:29.82 systemd-udevd
1383762 root 20 0 23240 2948 0 R 5.5 0.0 160:01.94 systemd-udevd
599455 root 20 0 35532 15252 0 R 5.2 0.2 246:01.83 systemd-udevd
867551 root 20 0 23240 2948 0 R 5.2 0.0 197:39.14 systemd-udevd
2084650 root 20 0 23240 2948 0 R 5.2 0.0 123:10.51 systemd-udevd
1906684 root 20 0 23240 2948 0 R 4.9 0.0 131:04.74 systemd-udevd
770329 root 20 0 22708 2488 0 R 4.6 0.0 212:20.44 systemd-udevd
890295 root 20 0 23240 2948 0 R 4.2 0.0 195:47.40 systemd-udevd
780768 root 20 0 1932764 96716 27984 S 2.3 1.2 99:27.87 containerd
当我跑步时,udevadm monitor
我会得到如下重复的序列:
KERNEL[124229.147890] add /devices/virtual/net/calico_tmp_B (net)
KERNEL[124229.148029] add /devices/virtual/net/calico_tmp_B/queues/rx-0 (queues)
KERNEL[124229.148101] add /devices/virtual/net/calico_tmp_B/queues/tx-0 (queues)
KERNEL[124229.148660] add /devices/virtual/net/calico_tmp_A (net)
KERNEL[124229.148764] add /devices/virtual/net/calico_tmp_A/queues/rx-0 (queues)
KERNEL[124229.148830] add /devices/virtual/net/calico_tmp_A/queues/tx-0 (queues)
UDEV [124229.313680] remove /devices/virtual/net/calico_tmp_A/queues/rx-0 (queues)
KERNEL[124229.408421] remove /devices/virtual/net/calico_tmp_A/queues/rx-0 (queues)
KERNEL[124229.408530] remove /devices/virtual/net/calico_tmp_A/queues/tx-0 (queues)
KERNEL[124229.408614] remove /devices/virtual/net/calico_tmp_A (net)
KERNEL[124229.515488] remove /devices/virtual/net/calico_tmp_B/queues/rx-0 (queues)
KERNEL[124229.515593] remove /devices/virtual/net/calico_tmp_B/queues/tx-0 (queues)
KERNEL[124229.515675] remove /devices/virtual/net/calico_tmp_B (net)
UDEV [124229.727966] remove /devices/virtual/net/calico_tmp_A/queues/tx-0 (queues)
UDEV [124230.646980] remove /devices/virtual/net/calico_tmp_A (net)
KERNEL[124238.148409] add /devices/virtual/net/calico_tmp_B (net)
KERNEL[124238.148522] add /devices/virtual/net/calico_tmp_B/queues/rx-0 (queues)
KERNEL[124238.148587] add /devices/virtual/net/calico_tmp_B/queues/tx-0 (queues)
KERNEL[124238.149038] add /devices/virtual/net/calico_tmp_A (net)
KERNEL[124238.149132] add /devices/virtual/net/calico_tmp_A/queues/rx-0 (queues)
KERNEL[124238.149196] add /devices/virtual/net/calico_tmp_A/queues/tx-0 (queues)
KERNEL[124238.257022] remove /devices/virtual/net/calico_tmp_A/queues/rx-0 (queues)
KERNEL[124238.257124] remove /devices/virtual/net/calico_tmp_A/queues/tx-0 (queues)
KERNEL[124238.257209] remove /devices/virtual/net/calico_tmp_A (net)
KERNEL[124238.263626] remove /devices/virtual/net/calico_tmp_B/queues/rx-0 (queues)
KERNEL[124238.263727] remove /devices/virtual/net/calico_tmp_B/queues/tx-0 (queues)
KERNEL[124238.263808] remove /devices/virtual/net/calico_tmp_B (net)
UDEV [124238.536622] add /devices/virtual/net/calico_tmp_A (net)
UDEV [124238.939643] add /devices/virtual/net/calico_tmp_A/queues/rx-0 (queues)
UDEV [124239.613507] add /devices/virtual/net/calico_tmp_A/queues/tx-0 (queues)
如果我重新启动,它可以正常启动,但随后负载会再次增加。
任何帮助都将受到赞赏。
答案1
我找到了解决方案。在 MicroK8s 上故障排除页面它提到应该为 Raspberry Pi 上的 Ubuntu 21.10 安装附加模块。运行后,sudo apt install linux-modules-extra-raspi
1.3 上的负载下降,问题消失。