故障现象:
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. CabloyJS微信模块、企业微信模块已出齐

    前言 当Cabloy-企业微信模块完成时,加上之前已完成的Cabloy-微信模块,关于在CabloyJS中与微信/企业微信对接的任务已经完成了.这些模块的目标就是,只需填入各类服务的参数,就可以直接进 ...

  2. Gitee整改之思考

    本文主要内容如下: 1.Gitee是什么? 2.Gitee与Github的区别有哪些? 3.为什么要使用Gitee? 4.Gitee的商业模式是怎样的? 5.Gitee为何会被整改? 6.Gitee这 ...

  3. 『忘了再学』Shell基础 — 31、字符处理相关命令

    目录 1.排序命令sort (1)sort命令介绍 (2)练习 2.取消重复行命令uniq 3.统计命令wc 1.排序命令sort (1)sort命令介绍 sort命令可针对文本文件的内容,以行为单位 ...

  4. JavaScript与Node.js一起打造一款聊天App

    聊天是我们人与人交流最直接的方式,互联网的加入使我们交流更加便捷.我们手机上的微信.QQ是我们手机必不可少的应用软件.那么,我们是否可以做一款聊天应用呢? 之前我自己闲着没事,研究过一些技术,做了一款 ...

  5. MySQL-4-DDL

    DDL:数据定义语言 创建create 创建库 语法:create database [if not exists]库名 # 创建库 CREATE DATABASE IF NOT EXISTS boo ...

  6. python 连接SAP 代码

    def Main(): sap_app = r"C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe" subproces ...

  7. SAP Web Dynpro - 应用程序中的服务调用

    您可以使用服务调用来调用Web Dynpro组件中的现有功能模块. 要创建服务呼叫,您可以使用Web Dynpro工具中易于使用的向导. 您可以在ABAP工作台中启动该向导以创建服务调用. 步骤1-选 ...

  8. 开发人员要学的Docker从入门到日常命令使用(通俗易懂),专业运维人员请勿点!

    一.介绍Docker  1.引言 问题1:开发人员告诉测试说自己的项目已经做好了,给你一个发布包,你去测试吧. ## 测试人员,为什么我运行会报错? ## 开发人员说,我本地运行没有问题呀!   解答 ...

  9. NC19916 [CQOI2010]扑克牌

    NC19916 [CQOI2010]扑克牌 题目 题目描述 你有n种牌,第i种牌的数目为 \(c_i\) .另外有一种特殊的牌:joker,它的数目是m.你可以用每种牌各一张来组成一套牌,也可以用一张 ...

  10. 游戏启动后提示安装HMS Core,点击取消,未再次提示安装HMS Core(初始化失败返回907135003)

    问题描述 我们国内的华为联运游戏集成华为游戏服务SDK 之后,被审核驳回:在未安装或需要更新华为移动服务(HMS Core)的手机上,提示安装华为移动服务,点击取消,未再次提示安装HMS Core. ...