# linux性能排查

1. 系统整体
   1. vmstat 1：每秒输出一次系统核心指标
   2. dmesg | tail：输出系统日志最后10行
2. CPU
   1. uptime：快速查看系统CPU负载情况：1分钟、5分钟、15分钟
   2. top：整体负载情况，通过P来排序CPU，通过M来排序内存
   3. mpstat -P ALL 1：每秒输出每个 CPU 的占用情况，如果有一个 CPU 占用率特别高，那么有可能是一个单线程应用程序引起的
3. 内存
   1. free -m：内存使用情况
4. 磁盘IO
   1. iostat -xz 1：每秒输出机器磁盘 IO 情况
5. 网络IO
   1. sar -n DEV 1: 每秒输出网络设备的吞吐率
   2. sar -n TCP,ETCP 1：每秒输出TCP连接状态
   3. route -n：路由信息
   4. dig,nslookup：DNS状态
   5. traceroute：路由节点状况与延时
6. 进程
   1. pidstat 1：每秒输出进程的CPU占用率
   2. tcpdump: 网络包协议追踪
   3. netstat：tcp连接信息
   4. ps -ef / -aux
   5. strace -p pid


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shuixn.gitbook.io/notebook/xing-neng-fen-xi/linux-xing-neng-pai-cha.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
