Skip to content

Commit 03212cd

Browse files
add linux 命令pidstat
1 parent be97415 commit 03212cd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

note/linux命令.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,27 @@ accept(3,
484484
485485
如果系统的平均负载不正常,比如大于1的时候,那可能需要思考一下,是不是出问题了。
486486
487+
* 使用vmstat命令
488+
489+
使用mpstat命令,除了可以看到cpu的占用率之外,还可以查看系统的的上下文切换次数和中断的次数。高频次的上下文切换和中断显然会降低系统的性能。
490+
491+
* 使用pidstat命令
492+
493+
pidstat命令可以定位到每一个具体的进程,可以看到她的进程切换指标。
494+
495+
```
496+
pidstat -w -u 1 #-w表示加入进程切换的指标
497+
```
498+
499+
* 查看中断次数
500+
501+
```
502+
watch -d cat /proc/interrupts
503+
504+
# 输出中的RES 表示的是 中断的次数
505+
```
506+
507+
487508
* linux的一个压力测试的工具
488509
489510
stress命令

0 commit comments

Comments
 (0)