File tree Expand file tree Collapse file tree 5 files changed +45
-4
lines changed Expand file tree Collapse file tree 5 files changed +45
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ endif::rootpath[]
11
11
12
12
== bcc
13
13
14
- image::../image/ eBPF/image-2025-02-21-15-49-53-474.png[]
14
+ image::eBPF/image-2025-02-21-15-49-53-474.png[]
15
15
16
16
=== 命令
17
17
@@ -105,10 +105,20 @@ TIME DISK %RND %SEQ COUNT KBYTES
105
105
106
106
==== biosnoop
107
107
108
- 用于追踪块设备 I/O(即磁盘 I/O),并为每次 I/O 操作打印一行输出。这对于分析磁盘性能、识别慢速 I/O 操作以及了解系统中磁盘活动的具体细节非常有用。
108
+ 用于追踪块设备 I/O(即磁盘 I/O),并为每次 I/O 操作打印一行输出。这对于分析磁盘性能、识别慢速 I/O 操作以及了解系统中磁盘活动的具体细节非常有用。进程的每次操作都会打印一次,这样就能根据延时来查看具体进程的I/O性能。
109
109
110
110
- biosnoop: 检查单个I/O
111
111
112
+ [source,bash]
113
+ ----
114
+ [root@k8smaster-ims tools]# ./biosnoop
115
+ TIME(s) COMM PID DISK T SECTOR BYTES LAT(ms)
116
+ 0.000000 etcd 13383 sda W 2206026528 8192 0.52
117
+ 0.000965 jbd2/dm-0-8 551 sda W 1259008848 86016 0.70
118
+ 0.001762 kworker/1:2 3671312 sda W 1259009016 4096 0.47
119
+ 0.008779 etcd 13383 sda W 42709832 4096 0.41
120
+ ----
121
+
112
122
==== biotop
113
123
114
124
用于实时显示哪些进程正在进行磁盘 I/O 操作。它类似于 top 命令,但专门针对磁盘 I/O 进行了优化,能够帮助用户识别出系统中占用大量磁盘资源的进程。
Original file line number Diff line number Diff line change
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+ === go内存三色标记法
14
+
15
+ https://www.ardanlabs.com/blog/2018/12/garbage-collection-in-go-part1-semantics.html[Garbage Collection In Go : Part I - Semantics]
16
+ http://ardanlabs.com/blog/2019/05/garbage-collection-in-go-part2-gctraces.html[Garbage Collection In Go : Part II - GC Traces]
17
+ https://www.ardanlabs.com/blog/2019/07/garbage-collection-in-go-part3-gcpacing.html[Garbage Collection In Go : Part III - GC Pacing]
Original file line number Diff line number Diff line change @@ -27,10 +27,12 @@ endif::rootpath[]
27
27
`cat /proc/cpuinfo` 查看CPU信息
28
28
29
29
30
- ==== pcstat
30
+ === pcstat
31
31
32
32
用来查看一个文件当前在内核中的缓存情况,以及缓存的命中率,通常用于排查那些需要读取文件频繁的程序,这些程序经常因为文件缓存命中率低而产生性能问题。
33
33
34
+ > pcstat 命令使用go语言实现,github地址 https://github.com/tobert/pcstat[pcstat]
35
+
34
36
[source,bash]
35
37
----
36
38
pcstat /tmp/test.txt
Original file line number Diff line number Diff line change @@ -13,12 +13,24 @@ endif::rootpath[]
13
13
== linux常见问题及排查手段
14
14
15
15
16
+ === 总和性排查
17
+
18
+ 一个命令查看出到底是CPU还是内存还是网络或者磁盘出现的问题,可以查看一下
19
+
20
+ [source,bash]
21
+ ----
22
+ # 每一行都会显示CPU使用,内存使用,磁盘读写,网络使用的情况, c: CPU,m: 内存,d: 磁盘,n: 网络
23
+ dstat -cmrdn
24
+ ----
25
+
26
+
27
+
16
28
=== CPU
17
29
18
30
19
31
=== 内存
20
32
21
- === 内存缺页
33
+ ==== 内存缺页
22
34
23
35
在 Linux 系统中,缺页中断(Page Fault)是操作系统内存管理中的一个重要概念。当程序试图访问一个不在物理内存中的页面时,就会发生缺页中断。根据页面是否需要从磁盘加载到内存,缺页中断可以分为两种类型:主缺页(Major Page Fault)和次缺页(Minor Page Fault)。
24
36
You can’t perform that action at this time.
0 commit comments