当我在笔记本电脑上使用无线连接时,我的 CPU 使用率出现了一些问题。
这在有线连接上从未发生过,因此我假设与 wifi 连接有一定关系。
top
gnome-shell
表示大多数资源被、浏览器和一些进程使用kworker
。
使用的网络资源越多,情况就越糟糕(例如,如果我开始下载)。这是一个 htop 屏幕,当我开始下载时,几个 gnome-shell 进程显示非常高的 CPU 使用率:
尝试使用perf
以查看哪个程序最耗 CPU,如下所建议:https://askubuntu.com/a/422151/700229但找不到任何可以指引我正确方向的东西,但输出可能很糟糕:
✓ ~→ sudo perf record -g -a sleep 10
Lowering default frequency rate to 1250.
Please consider tweaking /proc/sys/kernel/perf_event_max_sample_rate.
[ perf record: Woken up 9 times to write data ]
Warning:
Processed 52550 events and lost 2 chunks!
Check IO/CPU overload!
[ perf record: Captured and wrote 7.214 MB perf.data (26167 samples) ]
以下是 的输出lspci -v
:
3b:00.0 Network controller: Intel Corporation Wireless-AC 9260 (rev 29)
Subsystem: Intel Corporation Device 4010
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at ed400000 (64-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel driver in use: iwlwifi
Kernel modules: iwlwifi
和iwconfig
:
lo no wireless extensions.
br-2d6609084b03 no wireless extensions.
br-7083ba6447c1 no wireless extensions.
docker0 no wireless extensions.
wlp59s0 IEEE 802.11 ESSID:"XXX"
Mode:Managed Frequency:5.5 GHz Access Point: XX:XX:XX:XX:XX:XX
Bit Rate=650 Mb/s Tx-Power=22 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=45/70 Signal level=-65 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:7 Invalid misc:113 Missed beacon:0
我已检查 CPU 是否已设置为performance
开启tlp
,并且 wifi 电池保护程序已被禁用。
现在我有点不知道下一步该做什么。任何帮助我都非常感谢,因为我的工作取决于解决这个问题。
更新型多巴胺已安装的 gnome 扩展:
✓ ~→ ls -al ~/.local/share/gnome-shell/extensions
total 80
drwxrwxr-x 20 sergio sergio 4096 Mar 15 17:33 .
drwx------ 3 sergio sergio 4096 Mar 15 17:31 ..
drwxrwxr-x 3 sergio sergio 4096 Jul 24 2019 [email protected]
drwxrwxr-x 3 sergio sergio 4096 Jun 13 2019 [email protected]
drwxrwxr-x 3 sergio sergio 4096 Mar 15 17:33 [email protected]
drwxrwxr-x 4 sergio sergio 4096 Aug 5 2019 [email protected]
drwxrwxr-x 5 sergio sergio 4096 Jun 13 2019 [email protected]
drwxrwxr-x 3 sergio sergio 4096 Jul 24 2019 [email protected]
drwxrwxr-x 4 sergio sergio 4096 Feb 28 14:25 [email protected]
drwxrwxr-x 2 sergio sergio 4096 Sep 27 12:22 [email protected]
drwxrwxr-x 2 sergio sergio 4096 Jul 24 2019 [email protected]
drwxrwxr-x 5 sergio sergio 4096 Feb 28 14:25 [email protected]
drwxrwxr-x 3 sergio sergio 4096 Jul 24 2019 native-window-placement@gnome-shell-extensions.gcampax.github.com
drwxrwxr-x 2 sergio sergio 4096 Jun 13 2019 [email protected]
drwxrwxr-x 3 sergio sergio 4096 Jul 24 2019 [email protected]
drwxrwxr-x 2 sergio sergio 4096 Sep 19 15:35 [email protected]
drwxrwxr-x 4 sergio sergio 4096 Feb 22 16:20 [email protected]@posteo.de
drwxrwxr-x 4 sergio sergio 4096 Jun 13 2019 [email protected]
drwxrwxr-x 3 sergio sergio 4096 Jul 24 2019 [email protected]
drwxrwxr-x 3 sergio sergio 4096 Aug 5 2019 [email protected]
✓ ~→ ls -al /usr/share/gnome-shell/extensions
total 48
drwxr-xr-x 12 root root 4096 Aug 5 2019 .
drwxr-xr-x 6 root root 4096 Jan 15 06:59 ..
drwxr-xr-x 2 root root 4096 Jun 13 2019 [email protected]
drwxr-xr-x 2 root root 4096 Jun 13 2019 [email protected]
drwxr-xr-x 2 root root 4096 Jun 13 2019 [email protected]
drwxr-xr-x 2 root root 4096 Jun 13 2019 [email protected]
drwxr-xr-x 2 root root 4096 Jun 13 2019 [email protected]
drwxr-xr-x 2 root root 4096 Jun 13 2019 native-window-placement@gnome-shell-extensions.gcampax.github.com
drwxr-xr-x 2 root root 4096 Jun 13 2019 [email protected]
drwxr-xr-x 2 root root 4096 Jun 13 2019 [email protected]
drwxr-xr-x 2 root root 4096 Jun 13 2019 [email protected]
drwxr-xr-x 2 root root 4096 Jun 13 2019 [email protected]
UPD3可用内存和交换量:
✓ ~→ free -h
total used free shared buff/cache available
Mem: 30G 2.4G 24G 782M 3.6G 27G
Swap: 16G 0B 16G
✓ ~→ sysctl vm.swappiness
vm.swappiness = 10
答案1
天哪!@#$% 蝙蝠侠。你方式GNOME Shell 扩展太多,其中许多在应该存在扩展的地方重复出现。
系统扩展仅ls -al /usr/share/gnome-shell/extensions
应包含这些(19.10):
drwxr-xr-x 2 root root 4096 Nov 2 14:36 desktop-icons@csoriano
drwxr-xr-x 3 root root 4096 Nov 2 14:36 [email protected]
drwxr-xr-x 3 root root 4096 Mar 12 16:22 [email protected]
用户扩展通常通过 来查看ls -al ~/.local/share/gnome-shell/extensions
。
删除中的重复项/usr/share/gnome-shell/extensions
。
然后重新启动 GNOME Shell,或者更好的是,只需重新启动。
然后暂时关闭所有剩余的扩展https://extensions.gnome.org/local/并重新测试您的系统。测试期间一次只打开一个扩展。监控命令top
,GNOME Shell CPU 使用率应低于 2%。目标是最多只启用 5-6 个扩展。放弃其余的。
然后重新启动 GNOME Shell,或者更好的是,只需重新启动。
答案2
我也遇到了同样的问题。打开飞行模式并重新激活 wifi。这对我有用。