故障现象:
top - 14:02:56 up 250 days, 18:33, 7 users, load average: 142.92, 142.85, 142.80
Tasks: 731 total, 1 running, 660 sleeping, 0 stopped, 70 zombie
%Cpu(s): 0.2 us, 4.6 sy, 0.0 ni, 7.2 id, 87.8 wa, 0.0 hi, 0.3 si, 0.0 st
KiB Mem : 98496200 total, 14529116 free, 22914272 used, 61052812 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 55247796 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
407487 root 20 0 0 0 0 S 5.6 0.0 17:50.98 kworker/u81:12
99193 root 20 0 3253588 57688 9400 S 5.3 0.1 166:18.75 spider-agent
261323 root 20 0 0 0 0 S 5.3 0.0 13:34.79 kworker/u81:2
347197 root 20 0 0 0 0 S 5.3 0.0 3:19.92 kworker/u81:17
509610 root 20 0 0 0 0 S 5.3 0.0 0:43.81 kworker/u81:4
191853 root 20 0 0 0 0 S 5.0 0.0 0:54.08 kworker/u81:9
234072 root 20 0 0 0 0 S 5.0 0.0 0:34.99 kworker/u81:6
471654 root 20 0 0 0 0 S 5.0 0.0 10:47.46 kworker/u81:18
300850 root 0 -20 0 0 0 S 4.3 0.0 0:17.58 kworker/2:1H
7255 root 20 0 0 0 0 S 4.0 0.0 1:49.39 kworker/u81:16
118244 root 20 0 0 0 0 S 4.0 0.0 0:23.76 kworker/u81:0
136104 root 0 -20 0 0 0 S 4.0 0.0 14:45.31 kworker/10:2H
136932 root 0 -20 0 0 0 S 4.0 0.0 31:03.85 kworker/19:2H

通过debugfs trace相应的worker,/sys/kernel/debug/tracing/events/workqueue目录下enable 对应的trace开关

cat /sys/kernel/debug/tracing/trace >/home/caq/caq_trace.txt

<...>-291745 [032] .... 21345503.523189: rpc_task_run_action: task:56962@5 flags=4801 state=0005 status=96 action=call_decode [sunrpc]
<...>-291745 [032] .... 21345503.523190: rpc_task_run_action: task:56962@5 flags=4801 state=0005 status=-10023 action=rpc_exit_task [sunrpc]
<...>-291745 [032] ..s. 21345503.523191: rpc_task_wakeup: task:56982@5 flags=4001 state=0006 status=0 timeout=0 queue=ForeChannel Slot table
<...>-291745 [032] ..s. 21345503.523192: rpc_task_sleep: task:56962@5 flags=4801 state=0005 status=-10023 timeout=0 queue=NFS client
<...>-291745 [032] .... 21345503.523194: rpc_task_run_action: task:56982@5 flags=4001 state=0005 status=0 action=rpc_prepare_task [sunrpc]
<...>-291745 [032] .... 21345503.523195: rpc_task_run_action: task:56982@5 flags=4001 state=0005 status=0 action=call_start [sunrpc]
<...>-291745 [032] .... 21345503.523195: rpc_task_run_action: task:56982@5 flags=4001 state=0005 status=0 action=call_reserve [sunrpc]
<...>-291745 [032] ..s. 21345503.523195: rpc_task_sleep: task:56982@5 flags=4001 state=0005 status=-11 timeout=0 queue=xprt_sending
<...>-291745 [032] .... 21345503.523322: rpc_task_run_action: task:56932@5 flags=4801 state=0005 status=0 action=call_status [sunrpc]
<...>-291745 [032] .... 21345503.523322: rpc_task_run_action: task:56932@5 flags=4801 state=0005 status=0 action=call_status [sunrpc]
<...>-291745 [032] .... 21345503.523322: rpc_task_run_action: task:56932@5 flags=4801 state=0005 status=96 action=call_decode [sunrpc]
<...>-291745 [032] .... 21345503.523323: rpc_task_run_action: task:56932@5 flags=4801 state=0005 status=-10023 action=rpc_exit_task [sunrpc]
<...>-291745 [032] ..s. 21345503.523325: rpc_task_sleep: task:56932@5 flags=4801 state=0005 status=-10023 timeout=0 queue=NFS client
<...>-291745 [032] .... 21345503.523358: rpc_task_run_action: task:56948@5 flags=4801 state=0005 status=0 action=call_status [sunrpc]
<...>-291745 [032] .... 21345503.523358: rpc_task_run_action: task:56948@5 flags=4801 state=0005 status=0 action=call_status [sunrpc]
<...>-291745 [032] .... 21345503.523358: rpc_task_run_action: task:56948@5 flags=4801 state=0005 status=96 action=call_decode [sunrpc]
<...>-291745 [032] .... 21345503.523359: rpc_task_run_action: task:56948@5 flags=4801 state=0005 status=-10023 action=rpc_exit_task [sunrpc]
<...>-291745 [032] ..s. 21345503.523361: rpc_task_sleep: task:56948@5 flags=4801 state=0005 status=-10023 timeout=0 queue=NFS client
<...>-291745 [032] .... 21345503.523363: rpc_task_run_action: task:56965@5 flags=4801 state=0005 status=0 action=call_status [sunrpc]
<...>-291745 [032] .... 21345503.523363: rpc_task_run_action: task:56965@5 flags=4801 state=0005 status=0 action=call_status [sunrpc]
<...>-291745 [032] .... 21345503.523363: rpc_task_run_action: task:56965@5 flags=4801 state=0005 status=96 action=call_decode [sunrpc]
<...>-291745 [032] .... 21345503.523364: rpc_task_run_action: task:56965@5 flags=4801 state=0005 status=-10023 action=rpc_exit_task [sunrpc]
<...>-291745 [032] ..s. 21345503.523365: rpc_task_sleep: task:56965@5 flags=4801 state=0005 status=-10023 timeout=0 queue=NFS client
<...>-291745 [032] .... 21345503.523595: rpc_task_run_action: task:57001@5 flags=4801 state=0005 status=0 action=call_status [sunrpc]
<...>-291745 [032] .... 21345503.523595: rpc_task_run_action: task:57001@5 flags=4801 state=0005 status=0 action=call_status [sunrpc]
<...>-291745 [032] .... 21345503.523595: rpc_task_run_action: task:57001@5 flags=4801 state=0005 status=96 action=call_decode [sunrpc]
<...>-291745 [032] .... 21345503.523596: rpc_task_run_action: task:57001@5 flags=4801 state=0005 status=-10023 action=rpc_exit_task [sunrpc]
<...>-291745 [032] ..s. 21345503.523597: rpc_task_sleep: task:57001@5 flags=4801 state=0005 status=-10023 timeout=0 queue=NFS client
<...>-291745 [032] .... 21345503.523601: rpc_task_run_action: task:56958@5 flags=4801 state=0005 status=0 action=call_status [sunrpc]

查看对应的task,确定对应的进程。

然后开始找规律,找到某一类进程
获取他们的堆栈:
foreach start.sh bt -f >4_27_bt_full_start.sh.txt

获取对应的page:grep wait_on_page_bit 4_27_bt_full_start.sh.txt -A 1 |grep : |awk '{print "0x"$2}' |sort -u >page.txt

由于对应的容器是需要关闭的,所以先给他们的信号挂一下,
ps -ef |grep -i defu |grep -v grep |awk '{print $3}' |xargs kill -9

然后清除对应的writeback标志,设置上error标志
SetPageError(page);
end_page_writeback(page);

这里面存在类似锁的竞态等东西,需要仔细抠代码,切不可乱搞。
唤醒之后,这些僵尸进程和一直等待nfs返回的进程全部干掉了,系统恢复了它往常的宁静。
top - 12:21:10 up 251 days, 16:51, 6 users, load average: 5.21, 5.17, 7.87
Tasks: 406 total, 2 running, 404 sleeping, 0 stopped, 0 zombie
%Cpu(s): 2.4 us, 0.4 sy, 0.0 ni, 97.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 98496200 total, 35805640 free, 2128976 used, 60561584 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 76195712 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
474797 root 20 0 186296 13584 5308 R 47.1 0.0 0:00.08 rpm
122223 openvsw+ 10 -10 3086632 362504 12192 S 5.9 0.4 6000:29 ovs-vswitchd
474796 root 20 0 162304 2544 1552 R 5.9 0.0 0:00.01 top
1 root 20 0 203116 16108 2644 S 0.0 0.0 414:11.92 systemd
2 root 20 0 0 0 0 S 0.0 0.0 557:02.77 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 43:18.94 ksoftirqd/0
8 root rt 0 0 0 0 S 0.0 0.0 39:56.12 migration/0
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
10 root 20 0 0 0 0 S 0.0 0.0 1219:01 rcu_sched
11 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 lru-add-drain
12 root rt 0 0 0 0 S 0.0 0.0 2:32.05 watchdog/0

如何给load average 退烧的更多相关文章

  1. Load Average

    在Linux系统下面,有很多的命令可以查看系统的负载情况:比如top,uptime,w,示例如下: [wenchao.ren@l-cmsweb1.ops.cn1 ~]$ w 18:39:10 up 7 ...

  2. [转]理解Linux系统中的load average

    转自:http://heipark.iteye.com/blog/1340384 谢谢,写的非常好的文章. 一.什么是load average linux系统中的Load对当前CPU工作量的度量 (W ...

  3. linux 平均负载 load average 的含义

      load average 的含义 平均负载(load average)是指系统的运行队列的平均利用率,也可以认为是可运行进程的平均数. 以路况为例, 单核CPU.单车道 情况如下: 0.00-1. ...

  4. linux load average

    性能分析_linux服务器CPU_Load Average 理解Linux系统中的load average(图文版) 理解Load Average做好压力测试 top命令的Load average 含 ...

  5. Linux系统中的load average

    1. load average 定义 linux系统中的Load对当前CPU工作量的度量.简单的说是进程队列的长度. Load Average 就是一段时间 (1 分钟.5分钟.15分钟) 内平均 L ...

  6. 理解Linux系统中的load average(图文版)转

    一.什么是load average? linux系统中的Load对当前CPU工作量的度量 (WikiPedia: the system load is a measure of the amount ...

  7. Linux 通过 load average 判断服务器负载情况

    Linux中load average判断服务器负载情况 转载文章 http://www.111cn.net/sys/linux/56003.htm 写的比较详细,推荐看看.

  8. Linux系统Load average负载详细解释

    我们知道判断一个系统的负载可以使用top,uptime等命令去查看,它分别记录了一分钟.五分钟.以及十五分钟的系统平均负载 例如我的某台服务器: $ uptime 09:50:21 up 200 da ...

  9. CPU使用率和Load Average的关系

    看了几篇博客总结的区别,自己终于明白了含义,在这里将理解总结一下: 对于定义和解释,感觉淘测试上的更容易理解: 引用如下: CPU使用率:  一段时间内CPU的使用状况,从这个指标可以看出某一段时间内 ...

随机推荐

  1. 入坑KeePass(三)安全设置完后后留存

    1.文件> 数据库设置 > 安全 迭代次数改成500000 2.工具 > 选项 2.1.安全 2.2.策略 2.3.集成 2.4高级

  2. Redis初启(一)

    1.数据库存存储性能优化 在mysql的文章专题中我写过了关于传统关系型数据库的一些优化思路,整体来说,通过优化之后能够提升程序访问数据库的计算性能.但是还是有一些情况,即便是优化之后,使用传统关系型 ...

  3. ExtJS直接加载HTML页面

    ExtJS直接加载HTML页面 说明 ExtJS组件很不错,但再完美也有需要其他组件的时候,比如有时候就需要引入已经写好的HTML页面.主要的方法如下. 测试环境:ExtJS 7.4 使用html配置 ...

  4. 解决Windows微软账户无法登录

    更新记录 2022年4月16日:本文迁移自Panda666原博客,原发布时间:2021年8月25日. 将DNS的服务器地址修改为4.2.2.1或者4.2.2.2就可以解决无法登录microsoft账户 ...

  5. 前端环境搭建nodejs%VScode

    nodejs:https://blog.csdn.net/antma/article/details/86104068VScode:https://code.visualstudio.com/Down ...

  6. JavaScript 防盗链的原理以及破解方法

    先说说防盗链的原理,http 协议中,如果从一个网页跳到另一个网页,http 头字段里面会带个 Referer.这里的Referer是由于历史原因导致了拼写错误 后来也就一直沿用.图片服务器通过检测 ...

  7. SAP APO-PP / DS

    在SAP APO中,使用生产计划/详细计划(Production Planning/Detailed Scheduling)生成满足生产要求的采购建议. 此组件还用于定义资源计划和订单明细. 您还可以 ...

  8. 内存泄漏定位工具之 valgrind 使用

    1 前言 前面介绍了 GCC 自带的 mtrace 内存泄漏检查工具,该篇主要介绍开源的内存泄漏工具 valgrind,valgrind 是一套 Linux 下,开放源代码的动态调试工具集合,能够检测 ...

  9. Java数组和Arrays 类

    1.创建数组的三种方式: ①动态初始化:数组的初始化和数组元素的赋值操作分开进行 dataType[ ] arrayRefVar = new dataType [ arraySize ] ; Emp ...

  10. 网络通信协议分类和IP地址

    网络通信协议分类 通信的协议还是比较复杂的,java.net 包中包含的类和接口,它们提供低层次的通信细节.我们可以直接使用这些类和接口,来专注于网络程序开发,而不用考虑通信的细节 java.net ...