重启后,我发现性能明显变差。这在整个机器上都很明显(使用应用程序、浏览器、终端等),但我将使用这个特定的编译,因为它很容易量化,而且我知道它需要多少时间应该拿:
前:
$ time npm run build:app
# ... snip
real 0m7.545s
user 0m11.205s
sys 0m0.266s
后:
time npm run build:app
# ... snip
real 0m43.877s
user 1m15.089s
sys 0m2.319s
钱币。
这个问题第一次出现是在 9 月 1 日,我连续几天没有理会“您的机器需要在更新后重新启动”对话框。我尝试了以下方法来解决它:
- 确保固件是最新的
- 安装 cpufreq 以检查 CPU 扩展是否正确进行(我认为是的)。在“性能”和“省电”模式下,问题仍然存在
- 不运行任何其他程序(关闭 docker、containerd、nginx 等服务)
- 拔掉所有多余的 USB 设备(是的,我知道。)
在放弃并继续使用运行缓慢的机器后,9 月 2 日,在将其从休眠状态唤醒后,问题莫名其妙地得到了解决。现在,我害怕将来所有的软件升级。
本周,又出现了“您需要重启”的对话框,我故意忽略了它,直到今天。重启后,问题又出现了。
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 39 bits physical, 48 bits virtual
CPU(s): 16
On-line CPU(s) list: 0-15
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 158
Model name: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Stepping: 13
CPU MHz: 2400.000
CPU max MHz: 5000.0000
CPU min MHz: 800.0000
BogoMIPS: 4800.00
Virtualization: VT-x
L1d cache: 256 KiB
L1i cache: 256 KiB
L2 cache: 2 MiB
L3 cache: 16 MiB
NUMA node0 CPU(s): 0-15
Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling
Vulnerability Srbds: Mitigation; TSX disabled
Vulnerability Tsx async abort: Mitigation; TSX disabled
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_per
fmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic mov
be popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriorit
y ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_
notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities
以下是顶部:
top - 13:34:51 up 51 min, 1 user, load average: 0.11, 0.34, 0.42
Tasks: 436 total, 1 running, 435 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.2 us, 0.2 sy, 0.0 ni, 99.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 31864.7 total, 27013.6 free, 1493.9 used, 3357.1 buff/cache
MiB Swap: 0.0 total, 0.0 free, 0.0 used. 29907.1 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3208 root 20 0 24.3g 117428 74468 S 1.0 0.4 1:44.13 Xorg
5000 user 20 0 825840 59472 40508 S 1.0 0.2 0:33.68 gnome-terminal-
1690 root -51 0 0 0 0 S 0.7 0.0 1:11.28 irq/190-nvidia
1703 root 20 0 273764 9464 8620 S 0.7 0.0 0:13.08 thermald
9183 user 20 0 12364 4476 3256 R 0.7 0.0 0:00.67 top
3396 user 20 0 4642344 483188 122828 S 0.3 1.5 2:39.44 gnome-shell
3593 user 20 0 361428 43756 25164 S 0.3 0.1 0:05.85 indicator-cpufr
1 root 20 0 170164 12324 8448 S 0.0 0.0 0:02.53 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd
...
$ service --status-all
[ + ] acpid
[ - ] alsa-utils
[ - ] anacron
[ + ] apparmor
[ + ] apport
[ + ] avahi-daemon
[ + ] binfmt-support
[ + ] bluetooth
[ - ] cgroupfs-mount
[ - ] console-setup.sh
[ + ] cpufrequtils
[ + ] cron
[ - ] cryptdisks
[ - ] cryptdisks-early
[ + ] cups
[ + ] cups-browsed
[ + ] dbus
[ - ] docker
[ + ] gdm3
[ - ] gdomap
[ - ] grub-common
[ - ] hwclock.sh
[ + ] irqbalance
[ + ] kerneloops
[ - ] keyboard-setup.sh
[ + ] kmod
[ + ] loadcpufreq
[ - ] lvm2
[ - ] lvm2-lvmpolld
[ + ] network-manager
[ - ] nginx
[ + ] openvpn
[ - ] plymouth
[ - ] plymouth-log
[ - ] postgresql
[ - ] pppd-dns
[ + ] procps
[ - ] pulseaudio-enable-autospawn
[ - ] rsync
[ + ] rsyslog
[ - ] saned
[ - ] speech-dispatcher
[ - ] spice-vdagent
[ - ] sysstat
[ + ] udev
[ + ] ufw
[ + ] unattended-upgrades
[ - ] uuidd
[ - ] virtualbox
[ + ] whoopsie
[ - ] x11-common
我有apt
日志,看是否有帮助。
任何帮助都将不胜感激!
更新:
因为我知道有人会问:
$ nvidia-smi
Sat Sep 11 13:57:39 2021
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.57.02 Driver Version: 470.57.02 CUDA Version: 11.4 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Quadro RTX 3000 On | 00000000:01:00.0 On | N/A |
| N/A 50C P8 15W / N/A | 563MiB / 5934MiB | 4% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1975 G /usr/lib/xorg/Xorg 161MiB |
| 0 N/A N/A 3208 G /usr/lib/xorg/Xorg 200MiB |
| 0 N/A N/A 3396 G /usr/bin/gnome-shell 49MiB |
| 0 N/A N/A 9375 G /usr/lib/firefox/firefox 140MiB |
+-----------------------------------------------------------------------------+
更新 2:
睡眠/休眠确实可以解决问题。稍后再试,一切正常。