编辑4 因此大多数情况下,这个问题似乎发生在某些东西加载到内存时。
我尝试进行压力测试:
stress --cpu 8 --io 4 --vm 4 --vm-bytes 1024M --timeout 10s
这没什么用,但当我加倍(有时需要更多)时,--vm-bytes
一切都会冻结 10 秒钟。所以我猜想存在内存问题,但我不知道下一步该怎么做。
编辑结束4
我遇到了问题Ubuntu 18.04
,几个星期都无法调试这个问题。我希望你能帮助我诊断它,因为除了重新安装之外,我真的尝试了一切方法Ubuntu
。
它会随机(大约每分钟一次)短暂冻结,并开始发出噼啪声。感觉像是CPU
出GPU
了问题,但我不知道问题出在哪里。这种情况大多发生在我打开窗口或刷新 chrome 标签等时,但有时在我什么都不做时也会发生。
此外,视频播放器有时会完全冻结Ubuntu
。
我连接了三台显示器,GPU
但即使连接了两台显示器也会发生这种情况。GTX 1060 6GB
htop
诸如或之类的事情top
没有帮助——我必须实时检查它,即使这样也无济于事。
难道没有某种东西可以检测 CPU、RAM 和 DISK 峰值并将其与导致这些峰值的进程的信息一起记录在某处吗?
以下是一些信息:
- 我已禁用
gnome
扩展程序 - 我已经重新安装了
NVIDIA
驱动程序
- 尝试过是否发生于
chrome
关闭时,确认发生 top
当这种情况发生时,我没有看到像 100% CPU 这样的情况
编辑
冻结/噼啪声不是由任何 cron 作业引起的,它显然主要发生在我执行诸如打开 windows、刷新 chrome 等操作时。
删除交换文件没有帮助。
df -h
Filesystem Size Used Avail Use% Mounted on
udev 7,8G 0 7,8G 0% /dev
tmpfs 1,6G 3,0M 1,6G 1% /run
/dev/nvme0n1p1 440G 257G 161G 62% /
tmpfs 7,8G 238M 7,6G 3% /dev/shm
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 7,8G 0 7,8G 0% /sys/fs/cgroup
/dev/loop1 441M 441M 0 100% /snap/wine-platform/103
/dev/loop0 133M 133M 0 100% /snap/postman/81
/dev/loop2 128K 128K 0 100% /snap/cncra2yr/35
/dev/loop4 153M 153M 0 100% /snap/ramboxpro/6
/dev/loop3 92M 92M 0 100% /snap/core/6531
/dev/loop5 145M 145M 0 100% /snap/wavebox/163
/dev/loop6 156M 156M 0 100% /snap/brave/57
/dev/loop8 144M 144M 0 100% /snap/wavebox/161
/dev/loop7 5,2M 5,2M 0 100% /snap/htop/1066
/dev/loop12 91M 91M 0 100% /snap/core/6405
/dev/loop9 100M 100M 0 100% /snap/sensors-unity/75
/dev/loop10 35M 35M 0 100% /snap/gtk-common-themes/1122
/dev/loop13 100M 100M 0 100% /snap/qxmledit/129
/dev/loop11 13M 13M 0 100% /snap/gnome-characters/124
/dev/loop14 112M 112M 0 100% /snap/rambox/2
/dev/loop17 98M 98M 0 100% /snap/docker/321
/dev/loop15 5,9M 5,9M 0 100% /snap/htop/1168
/dev/loop16 144M 144M 0 100% /snap/wavebox/162
/dev/loop22 15M 15M 0 100% /snap/gnome-logs/43
/dev/loop19 145M 145M 0 100% /snap/slack/11
/dev/loop20 54M 54M 0 100% /snap/core18/782
/dev/loop23 4,2M 4,2M 0 100% /snap/gnome-calculator/352
/dev/loop24 402M 402M 0 100% /snap/redis-desktop-manager/191
/dev/loop26 144M 144M 0 100% /snap/gnome-3-28-1804/23
/dev/loop25 54M 54M 0 100% /snap/core18/731
/dev/loop18 340M 340M 0 100% /snap/pycharm-professional/121
/dev/loop21 288M 288M 0 100% /snap/datagrip/40
/dev/loop27 441M 441M 0 100% /snap/wine-platform/105
/dev/loop28 340M 340M 0 100% /snap/pycharm-professional/112
/dev/loop29 128K 128K 0 100% /snap/cncra2yr/34
/dev/loop30 15M 15M 0 100% /snap/gnome-logs/45
/dev/loop31 91M 91M 0 100% /snap/core/6350
/dev/loop32 2,3M 2,3M 0 100% /snap/gnome-calculator/238
/dev/loop33 3,8M 3,8M 0 100% /snap/gnome-system-monitor/57
/dev/loop34 13M 13M 0 100% /snap/gnome-characters/139
/dev/loop35 141M 141M 0 100% /snap/gnome-3-26-1604/78
/dev/loop37 100M 100M 0 100% /snap/qxmledit/125
/dev/loop36 141M 141M 0 100% /snap/gnome-3-26-1604/82
/dev/loop38 2,3M 2,3M 0 100% /snap/gnome-calculator/260
/dev/loop40 153M 153M 0 100% /snap/brave/44
/dev/loop39 35M 35M 0 100% /snap/gtk-common-themes/818
/dev/loop41 93M 93M 0 100% /snap/sensors-unity/67
/dev/loop43 131M 131M 0 100% /snap/postman/80
/dev/loop42 340M 340M 0 100% /snap/pycharm-professional/116
/dev/loop44 110M 110M 0 100% /snap/rambox/1
/dev/loop46 1,0M 1,0M 0 100% /snap/gnome-logs/57
/dev/loop45 158M 158M 0 100% /snap/brave/58
/dev/loop47 4,9M 4,9M 0 100% /snap/htop/959
/dev/loop48 141M 141M 0 100% /snap/gnome-3-26-1604/74
/dev/loop50 100M 100M 0 100% /snap/qxmledit/115
/dev/loop49 142M 142M 0 100% /snap/slack/10
/dev/loop52 36M 36M 0 100% /snap/gtk-common-themes/1198
/dev/loop51 3,8M 3,8M 0 100% /snap/gnome-system-monitor/54
/dev/loop53 441M 441M 0 100% /snap/wine-platform/101
/dev/loop54 145M 145M 0 100% /snap/slack/12
/dev/loop56 128K 128K 0 100% /snap/cncra2yr/36
/dev/loop59 15M 15M 0 100% /snap/gnome-characters/206
/dev/loop55 290M 290M 0 100% /snap/datagrip/42
/dev/loop57 275M 275M 0 100% /snap/datagrip/39
/dev/sdb2 95M 30M 66M 32% /boot/efi
/dev/loop58 3,8M 3,8M 0 100% /snap/gnome-system-monitor/70
tmpfs 1,6G 16K 1,6G 1% /run/user/121
tmpfs 1,6G 164K 1,6G 1% /run/user/1000
/dev/sdc1 932G 491G 442G 53% /media/milano/Milano Disk
psensor 的输出
编辑2
由于某种原因,我无法检查 SSD SMART 数据,disk-utility
但这是命令行的输出:
milano@milano-PC:~$ sudo smartctl -x /dev/nvme0n1p1
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-46-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: KINGSTON SA1000M8480G
Serial Number: 50026B7282169510
Firmware Version: E8FK11.L
PCI Vendor/Subsystem ID: 0x2646
IEEE OUI Identifier: 0x0026b7
Total NVM Capacity: 480 103 981 056 [480 GB]
Unallocated NVM Capacity: 0
Controller ID: 0
Number of Namespaces: 1
Namespace 1 Size/Capacity: 480 103 981 056 [480 GB]
Namespace 1 Formatted LBA Size: 512
Local Time is: Mon Mar 25 14:28:10 2019 CET
Firmware Updates (0x02): 1 Slot
Optional Admin Commands (0x0007): Security Format Frmw_DL
Optional NVM Commands (0x001e): Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat
Maximum Data Transfer Size: 512 Pages
Warning Comp. Temp. Threshold: 90 Celsius
Critical Comp. Temp. Threshold: 94 Celsius
Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 7.90W 0.0790W - 0 0 0 0 600 600
1 + 7.90W 0.0790W - 0 0 0 0 600 600
2 + 7.90W 0.0790W - 0 0 0 0 600 600
3 - 0.1000W 0.0790W - 3 3 3 3 1000 1000
4 - 0.0050W 0.0790W - 4 4 4 4 400000 90000
Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 0 1
1 - 4096 0 0
=== START OF SMART DATA SECTION ===
Read NVMe SMART/Health Information failed: NVMe Status 0x02
编辑3
milano@milano-PC:~$ sudo smartctl -x /dev/nvme0
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.15.0-46-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: KINGSTON SA1000M8480G
Serial Number: 50026B7282169510
Firmware Version: E8FK11.L
PCI Vendor/Subsystem ID: 0x2646
IEEE OUI Identifier: 0x0026b7
Total NVM Capacity: 480 103 981 056 [480 GB]
Unallocated NVM Capacity: 0
Controller ID: 0
Number of Namespaces: 1
Namespace 1 Size/Capacity: 480 103 981 056 [480 GB]
Namespace 1 Formatted LBA Size: 512
Local Time is: Mon Mar 25 14:31:22 2019 CET
Firmware Updates (0x02): 1 Slot
Optional Admin Commands (0x0007): Security Format Frmw_DL
Optional NVM Commands (0x001e): Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat
Maximum Data Transfer Size: 512 Pages
Warning Comp. Temp. Threshold: 90 Celsius
Critical Comp. Temp. Threshold: 94 Celsius
Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 7.90W 0.0790W - 0 0 0 0 600 600
1 + 7.90W 0.0790W - 0 0 0 0 600 600
2 + 7.90W 0.0790W - 0 0 0 0 600 600
3 - 0.1000W 0.0790W - 3 3 3 3 1000 1000
4 - 0.0050W 0.0790W - 4 4 4 4 400000 90000
Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 0 1
1 - 4096 0 0
=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
SMART/Health Information (NVMe Log 0x02, NSID 0xffffffff)
Critical Warning: 0x00
Temperature: 34 Celsius
Available Spare: 100%
Available Spare Threshold: 100%
Percentage Used: 1%
Data Units Read: 10 140 359 [5,19 TB]
Data Units Written: 11 376 845 [5,82 TB]
Host Read Commands: 169 519 743
Host Write Commands: 205 066 508
Controller Busy Time: 1 117
Power Cycles: 211
Power On Hours: 953
Unsafe Shutdowns: 12
Media and Data Integrity Errors: 0
Error Information Log Entries: 3
Warning Comp. Temperature Time: 0
Critical Comp. Temperature Time: 0
Temperature Sensor 2: 34 Celsius
Error Information (NVMe Log 0x01, max 16 entries)
Num ErrCount SQId CmdId Status PELoc LBA NSID VS
0 3 0 0x001d 0x0004 - 8323074 1 -
1 2 0 0x001d 0x0005 - 8323074 1 -
2 1 0 0x001d 0x0005 - 8323074 1 -
答案1
- htop 非常适合了解 CPU 和内存占用情况。请确保消除对 swap 的需求。Swap 正在使用您的硬盘和 CPU,这有时会使其工作速度变慢以应对所有 I/O。
iotop --only -d0.1
能够很好地向您展示磁盘的用途。- 用于
df -h
获取有关硬盘使用情况的信息。例如:众所周知,当可用空间被占用时,SSD 的运行速度会变慢。确保始终有大约 10% 的磁盘可用/空闲。
根据你所说的,我目前的猜测是这是关于每分钟运行的一些 cron 脚本,但这仍然只是猜测。
这里有一个关于您的 system.log snap 包的待处理的错误报告: https://bugs.launchpad.net/ubuntu/+source/gnome-system-monitor/+bug/1791454 确保订阅它并观察如何解决。