linux – 高负载平均,高等待,dmesg raid错误消息(debian nfs服务器)

Debian 6 on HP proliant(2 CPU)with raid(2 * 1.5T RAID1 2 * 2T RAID1加入RAID0制作3.5T)主要运行nfs& imapd(加上用于 Windows共享的samba和用于预览网页的本地www);本地ubuntu桌面客户端安装$HOME,笔记本电脑访问imap&奇数文件(例如视频)通过nfs / smb;通过家用路由器/交换机连接100baseT或wifi的盒子

uname -a

Linux prole 2.6.32-5-686 #1 SMP Wed Jan 11 12:29:30 UTC 2012 i686 GNU/Linux

安装程序已经工作了几个月,但是很容易间歇性地进行非常缓慢的用户体验(从服务器或笔记本电脑播放视频的桌面安装$HOME)现在一直都很糟糕我不得不深入研究它以试图找出错误(! )

服务器在低负载下似乎没问题(笔记本电脑)客户端(在本地磁盘上使用$HOME)连接到服务器的imapd和nfs挂载RAID以访问1个文件:top显示load~0.1或更少,0等待

但当(桌面)客户端安装$HOME并启动用户KDE会话(所有访问服务器)时,顶部显示例如

top - 13:41:17 up  3:43,3 users,load average: 9.29,9.55,8.27
Tasks: 158 total,1 running,157 sleeping,0 stopped,0 zombie
Cpu(s):  0.4%us,0.4%sy,0.0%ni,49.0%id,49.7%wa,0.0%hi,0.5%si,0.0%st
Mem:    903856k total,851784k used,52072k free,171152k buffers
Swap:        0k total,0k used,0k free,476896k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                     
 3935 root      20   0  2456 1088  784 R    2  0.1   0:00.02 top                                                                                                         
    1 root      20   0  2028  680  584 S    0  0.1   0:01.14 init                                                                                                        
    2 root      20   0     0    0    0 S    0  0.0   0:00.00 kthreadd                                                                                                    
    3 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/0                                                                                                 
    4 root      20   0     0    0    0 S    0  0.0   0:00.12 ksoftirqd/0                                                                                                 
    5 root      RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/0                                                                                                  
    6 root      RT   0     0    0    0 S    0  0.0   0:00.00 migration/1                                                                                                 
    7 root      20   0     0    0    0 S    0  0.0   0:00.16 ksoftirqd/1                                                                                                 
    8 root      RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/1                                                                                                  
    9 root      20   0     0    0    0 S    0  0.0   0:00.42 events/0                                                                                                    
   10 root      20   0     0    0    0 S    0  0.0   0:02.26 events/1                                                                                                    
   11 root      20   0     0    0    0 S    0  0.0   0:00.00 cpuset                                                                                                      
   12 root      20   0     0    0    0 S    0  0.0   0:00.00 khelper                                                                                                     
   13 root      20   0     0    0    0 S    0  0.0   0:00.00 netns                                                                                                       
   14 root      20   0     0    0    0 S    0  0.0   0:00.00 async/mgr                                                                                                   
   15 root      20   0     0    0    0 S    0  0.0   0:00.00 pm                                                                                                          
   16 root      20   0     0    0    0 S    0  0.0   0:00.02 sync_supers                                                                                                 
   17 root      20   0     0    0    0 S    0  0.0   0:00.02 bdi-default                                                                                                 
   18 root      20   0     0    0    0 S    0  0.0   0:00.00 kintegrityd/0                                                                                               
   19 root      20   0     0    0    0 S    0  0.0   0:00.00 kintegrityd/1                                                                                               
   20 root      20   0     0    0    0 S    0  0.0   0:00.02 kblockd/0                                                                                                   
   21 root      20   0     0    0    0 S    0  0.0   0:00.08 kblockd/1                                                                                                   
   22 root      20   0     0    0    0 S    0  0.0   0:00.00 kacpid                                                                                                      
   23 root      20   0     0    0    0 S    0  0.0   0:00.00 kacpi_notify                                                                                                
   24 root      20   0     0    0    0 S    0  0.0   0:00.00 kacpi_hotplug                                                                                               
   25 root      20   0     0    0    0 S    0  0.0   0:00.00 kseriod                                                                                                     
   28 root      20   0     0    0    0 S    0  0.0   0:04.19 kondemand/0                                                                                                 
   29 root      20   0     0    0    0 S    0  0.0   0:02.93 kondemand/1                                                                                                 
   30 root      20   0     0    0    0 S    0  0.0   0:00.00 khungtaskd                                                                                                  
   31 root      20   0     0    0    0 S    0  0.0   0:00.18 kswapd0                                                                                                     
   32 root      25   5     0    0    0 S    0  0.0   0:00.00 ksmd                                                                                                        
   33 root      20   0     0    0    0 S    0  0.0   0:00.00 aio/0                                                                                                       
   34 root      20   0     0    0    0 S    0  0.0   0:00.00 aio/1                                                                                                       
   35 root      20   0     0    0    0 S    0  0.0   0:00.00 crypto/0                                                                                                    
   36 root      20   0     0    0    0 S    0  0.0   0:00.00 crypto/1                                                                                                    
  203 root      20   0     0    0    0 S    0  0.0   0:00.00 ksuspend_usbd                                                                                               
  204 root      20   0     0    0    0 S    0  0.0   0:00.00 khubd                                                                                                       
  205 root      20   0     0    0    0 S    0  0.0   0:00.00 ata/0                                                                                                       
  206 root      20   0     0    0    0 S    0  0.0   0:00.00 ata/1                                                                                                       
  207 root      20   0     0    0    0 S    0  0.0   0:00.14 ata_aux                                                                                                     
  208 root      20   0     0    0    0 S    0  0.0   0:00.01 scsi_eh_0

dmesg建议存在磁盘问题:

.............. (previous episode)
[13276.966004] raid1:md0: read error corrected (8 sectors at 489900360 on sdc7)
[13276.966043] raid1: sdb7: redirecting sector 489898312 to another mirror

[13279.569186] ata4.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
[13279.569211] ata4.00: irq_stat 0x40000008
[13279.569230] ata4.00: failed command: READ FPDMA QUEUED
[13279.569257] ata4.00: cmd 60/08:00:00:6a:05/00:00:23:00:00/40 tag 0 ncq 4096 in
[13279.569262]          res 41/40:00:05:6a:05/00:00:23:00:00/40 Emask 0x409 (media error) <F>
[13279.569306] ata4.00: status: { DRDY ERR }
[13279.569321] ata4.00: error: { UNC }
[13279.575362] ata4.00: configured for UDMA/133
[13279.575388] ata4: EH complete
[13283.169224] ata4.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
[13283.169246] ata4.00: irq_stat 0x40000008
[13283.169263] ata4.00: failed command: READ FPDMA QUEUED
[13283.169289] ata4.00: cmd 60/08:00:00:6a:05/00:00:23:00:00/40 tag 0 ncq 4096 in
[13283.169294]          res 41/40:00:07:6a:05/00:00:23:00:00/40 Emask 0x409 (media error) <F>
[13283.169331] ata4.00: status: { DRDY ERR }
[13283.169345] ata4.00: error: { UNC }
[13283.176071] ata4.00: configured for UDMA/133
[13283.176104] ata4: EH complete
[13286.224814] ata4.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
[13286.224837] ata4.00: irq_stat 0x40000008
[13286.224853] ata4.00: failed command: READ FPDMA QUEUED
[13286.224879] ata4.00: cmd 60/08:00:00:6a:05/00:00:23:00:00/40 tag 0 ncq 4096 in
[13286.224884]          res 41/40:00:06:6a:05/00:00:23:00:00/40 Emask 0x409 (media error) <F>
[13286.224922] ata4.00: status: { DRDY ERR }
[13286.224935] ata4.00: error: { UNC }
[13286.231277] ata4.00: configured for UDMA/133
[13286.231303] ata4: EH complete
[13288.802623] ata4.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
[13288.802646] ata4.00: irq_stat 0x40000008
[13288.802662] ata4.00: failed command: READ FPDMA QUEUED
[13288.802688] ata4.00: cmd 60/08:00:00:6a:05/00:00:23:00:00/40 tag 0 ncq 4096 in
[13288.802693]          res 41/40:00:05:6a:05/00:00:23:00:00/40 Emask 0x409 (media error) <F>
[13288.802731] ata4.00: status: { DRDY ERR }
[13288.802745] ata4.00: error: { UNC }
[13288.808901] ata4.00: configured for UDMA/133
[13288.808927] ata4: EH complete
[13291.380430] ata4.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0
[13291.380453] ata4.00: irq_stat 0x40000008
[13291.380470] ata4.00: failed command: READ FPDMA QUEUED
[13291.380496] ata4.00: cmd 60/08:00:00:6a:05/00:00:23:00:00/40 tag 0 ncq 4096 in
[13291.380501]          res 41/40:00:05:6a:05/00:00:23:00:00/40 Emask 0x409 (media error) <F>
[13291.380577] ata4.00: status: { DRDY ERR }
[13291.380594] ata4.00: error: { UNC }
[13291.386517] ata4.00: configured for UDMA/133
[13291.386543] ata4: EH complete
[13294.347147] ata4.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0

[13294.347169] ata4.00: irq_stat 0x40000008
[13294.347186] ata4.00: failed command: READ FPDMA QUEUED
[13294.347211] ata4.00: cmd 60/08:00:00:6a:05/00:00:23:00:00/40 tag 0 ncq 4096 in
[13294.347217]          res 41/40:00:06:6a:05/00:00:23:00:00/40 Emask 0x409 (media error) <F>
[13294.347254] ata4.00: status: { DRDY ERR }
[13294.347268] ata4.00: error: { UNC }
[13294.353556] ata4.00: configured for UDMA/133
[13294.353583] sd 3:0:0:0: [sdc] Unhandled sense code
[13294.353590] sd 3:0:0:0: [sdc] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[13294.353599] sd 3:0:0:0: [sdc] Sense Key : Medium Error [current] [descriptor]
[13294.353610] Descriptor sense data with sense descriptors (in hex):
[13294.353616]         72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 
[13294.353635]         23 05 6a 06 
[13294.353644] sd 3:0:0:0: [sdc] Add. Sense: Unrecovered read error - auto reallocate failed
[13294.353657] sd 3:0:0:0: [sdc] CDB: Read(10): 28 00 23 05 6a 00 00 00 08 00
[13294.353675] end_request: I/O error,dev sdc,sector 587557382
[13294.353726] ata4: EH complete
[13294.366953] raid1:md0: read error corrected (8 sectors at 489900544 on sdc7)
[13294.366992] raid1: sdc7: redirecting sector 489898496 to another mirror

而且它们经常发生,我想这可能会导致性能问题(?)

#dmesg | grep镜子

[12433.561822] raid1: sdc7: redirecting sector 489900464 to another mirror
[12449.428933] raid1: sdb7: redirecting sector 489900504 to another mirror
[12464.807016] raid1: sdb7: redirecting sector 489900512 to another mirror
[12480.196222] raid1: sdb7: redirecting sector 489900520 to another mirror
[12495.585413] raid1: sdb7: redirecting sector 489900528 to another mirror
[12510.974424] raid1: sdb7: redirecting sector 489900536 to another mirror
[12526.374933] raid1: sdb7: redirecting sector 489900544 to another mirror
[12542.619938] raid1: sdc7: redirecting sector 489900608 to another mirror
[12559.431328] raid1: sdc7: redirecting sector 489900616 to another mirror
[12576.553866] raid1: sdc7: redirecting sector 489900624 to another mirror
[12592.065265] raid1: sdc7: redirecting sector 489900632 to another mirror
[12607.621121] raid1: sdc7: redirecting sector 489900640 to another mirror
[12623.165856] raid1: sdc7: redirecting sector 489900648 to another mirror
[12638.699474] raid1: sdc7: redirecting sector 489900656 to another mirror
[12655.610881] raid1: sdc7: redirecting sector 489900664 to another mirror
[12672.255617] raid1: sdc7: redirecting sector 489900672 to another mirror
[12672.288746] raid1: sdc7: redirecting sector 489900680 to another mirror
[12672.332376] raid1: sdc7: redirecting sector 489900688 to another mirror
[12672.362935] raid1: sdc7: redirecting sector 489900696 to another mirror
[12674.201177] raid1: sdc7: redirecting sector 489900704 to another mirror
[12698.045050] raid1: sdc7: redirecting sector 489900712 to another mirror
[12698.089309] raid1: sdc7: redirecting sector 489900720 to another mirror
[12698.111999] raid1: sdc7: redirecting sector 489900728 to another mirror
[12698.134006] raid1: sdc7: redirecting sector 489900736 to another mirror
[12719.034376] raid1: sdc7: redirecting sector 489900744 to another mirror
[12734.545775] raid1: sdc7: redirecting sector 489900752 to another mirror
[12734.590014] raid1: sdc7: redirecting sector 489900760 to another mirror
[12734.624050] raid1: sdc7: redirecting sector 489900768 to another mirror
[12734.647308] raid1: sdc7: redirecting sector 489900776 to another mirror
[12734.664657] raid1: sdc7: redirecting sector 489900784 to another mirror
[12734.710642] raid1: sdc7: redirecting sector 489900792 to another mirror
[12734.721919] raid1: sdc7: redirecting sector 489900800 to another mirror
[12734.744732] raid1: sdc7: redirecting sector 489900808 to another mirror
[12734.779330] raid1: sdc7: redirecting sector 489900816 to another mirror
[12782.604564] raid1: sdb7: redirecting sector 1242934216 to another mirror
[12798.264153] raid1: sdc7: redirecting sector 1242935080 to another mirror
[13245.832193] raid1: sdb7: redirecting sector 489898296 to another mirror
[13261.376929] raid1: sdb7: redirecting sector 489898304 to another mirror
[13276.966043] raid1: sdb7: redirecting sector 489898312 to another mirror
[13294.366992] raid1: sdc7: redirecting sector 489898496 to another mirror

尽管阵列仍在所有磁盘上运行 – 但它们还没有放弃:

#cat / proc / mdstat

Personalities : [raid1] [raid0] 
md10 : active raid0 md0[0] md1[1]
      3368770048 blocks super 1.2 512k chunks

md1 : active raid1 sde2[2] sdd2[1]
      1464087824 blocks super 1.2 [2/2] [UU]

md0 : active raid1 sdb7[0] sdc7[2]
      1904684920 blocks super 1.2 [2/2] [UU]

unused devices: <none>

所以我想我已经知道问题是什么,但我不是想象力最远的一个linux系统管理员专家,我真的很感激这里的线索检查我的诊断和我需要做什么:

>显然我需要为sdc采购另一个驱动器. (我猜我
如果价格合适,可以购买更大的驱动器:我在想
有一天,我需要增加数组的大小,那将是
一个较少的驱动器更换一个更大的驱动器)
>然后使用mdadm来失败现有的sdc,删除它并适合新的驱动器
> fdisk新驱动器与阵列的分区大小相同
>使用mdadm将新驱动器添加到阵列中

听起来不错?

解决方法

通常当您遇到磁盘错误时,磁盘会暂停一段时间以尝试纠正错误本身,并且Linux RAID将容忍某些磁盘等待,直到它标记为坏.这个磁盘暂停可能是导致速度减慢的原因(特别是在您看到的错误率时).

您更换驱动器的计划是正确的.但是,我不建议使用更换RAID的分区部分的概念来获得更大的驱动程序,然后再部分使用其他东西.更接近原始磁盘(大小和速度)以保持阵列一致更为明智.也就是说,从理论上讲,你可以做得更大,并为数组替换分配确切的替换大小,然后为其他东西(甚至是数组的另一个成员)划分另一个分区.

可能有助于调试的旁注:我喜欢用作顶部替换的工具称为atop(http://www.atoptool.nl/),它可以让您更加可视化使用磁盘I / O的每个磁盘和进程以及瓶颈所在的位置(您可能会注意到等待I / O是针对具有问题的特定磁盘).

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


linux常用进程通信方式包括管道(pipe)、有名管道(FIFO)、信号(signal)、消息队列、共享内存、信号量、套接字(socket)。管道用于具有亲缘关系的进程间通信,有名管道的每个管道具有名字,使没有亲缘关系的进程间也可以通信。信号是比较复杂的通信方式,用于通知接受进程有某种事件发生,除
Linux性能观测工具按类别可分为系统级别和进程级别,系统级别对整个系统的性能做统计,而进程级别则具体到进程,为每个进程维护统计信息。&#xD;&#xA;&#xD;&#xA;按实现原理分,可分为基于计数器和跟踪以及剖析。含义如下:&#xD;&#xA;&#xD;&#xA;计数器:内核维护的统计数据,通常为无符号整型,用于对发生的事件计数,比如,网络包接收计数器,磁
本文详细介绍了curl命令基础和高级用法,包括跳过https的证书验证,详细追踪整个交互过程,可用于调用网络后端接口,诊断http和https网络服务故障。
本文包含作者工作中常用到的一些命令,用于诊断网络、磁盘占满、fd泄漏等问题。命令包括ping、fping、tcpdump、lsof、netstat、/proc/$pid/fd、du、grep、traceroute、dig。
linux的平均负载表示运行态和就绪态及不可中断状态(正在io)的进程数目,用uptime查看到负载很高,既有可能是CPU利用率高,也可能是大量在等待io的进程导致,用mpstat查看每个CPU的使用情况,查看CPU的使用率或者CPU花在等待io的时间,接着用pidstat定位具体的进程
CPU上下文频繁切换会导致系统性能下降,切换分为进程切换、线程切换及中断切换,进程切换的开销较大,除了需要保存寄存器和程序计数器中的值还需保存全局变量、栈等到内存中,以便下次运行恢复,而同一进程中的线程切换开销会小很多,只需更新寄存器和线程独有的栈,共享资源如打开的文件、全局变量等无需切换,当硬件中
1.top命令 作用:该命令可以按CPU使用.内存使用和执行时间对任务进行排序,常用来监控系统中占用CPU或内存较高的程序及CPU和内存的负载。 默认视图: 当想看系统负载时,可观察汇总的%CPU中的us用户进程和sy系统进程是否占用CPU很高,相加接近100%就说明占用很高了,有些程序可能得不到及
文章浏览阅读1.8k次,点赞63次,收藏54次。Linux下的目录权限!!!粘滞位!!!超详解!!!
文章浏览阅读1.6k次,点赞44次,收藏38次。关于Qt的安装、Windows、Linux、MacBook_mack book 安装qt
本文介绍了使用shell脚本编写一个 Hello
文章浏览阅读1.5k次,点赞37次,收藏43次。【Linux】初识Linux——了解操作系统的发展历史以及初次体验Linux编程环境
文章浏览阅读3k次,点赞34次,收藏156次。Linux超详细笔记,个人学习时很认真的记录的,觉得好的麻烦点个赞。
文章浏览阅读6.8k次,点赞109次,收藏114次。【Linux】 OpenSSH_9.3p1 升级到 OpenSSH_9.5p1(亲测无问题,建议收藏)_openssh_9.5p1
文章浏览阅读3.5k次,点赞93次,收藏78次。初识Linux中的线程,理解线程的各种概念,理解进程地址空间中的页表转换,介绍pthread线程库并理解线程库!
文章浏览阅读863次。出现此问题为Linux文件权限问题,解决方案为回到引擎目录执行命令。输入用户密码后运行./UnrealEditor。_increasing per-process limit of core file size to infinity.
文章浏览阅读2.9k次。使用文本编辑器:打开CSV文件,并使用文本编辑器(如Notepad++、Sublime Text、Visual Studio Code等)来查看文件的字符编码格式。通常在编辑器的底部状态栏或设置中可以找到当前编码的显示。请注意,上述方法并非绝对准确,特别是当文件没有明确的编码标识时。因此,如果你发现CSV文件在不同的工具或方法中显示不同的编码格式,可能需要进行进一步的分析和判断,或者尝试使用不同的编码转换方法。该命令将输出文件的MIME类型和编码信息。使用命令行工具:在命令行中,你可以使用。_shell读取csv文件逐行处理
本文介绍了如何在Linux系统中升级gcc版本,以便更好地支持C++11及以上版本的新特性。通过升级gcc,可以提升编译器的功能和性能,获得更好的开发体验。详细的步骤和方法请参考原文链接。
文章浏览阅读4.4k次,点赞6次,收藏19次。Mosquitto是一个开源的MQTT消息代理服务器。MQTT是一个轻量级的、基于发布/订阅模式的消息传输协议。 mosquitto的安装使用比较简单,可以方便的来进行一些测试。_linux mosquitto
文章浏览阅读7.2k次,点赞2次,收藏12次。Linux中,用于根目录下有一个.ssh目录,保存了ssh相关的key和一些记录文件。_~/.ssh/
文章浏览阅读4.5k次,点赞5次,收藏18次。首先需要安装 snmp ,使用下面的命令进行安装安装完毕之后,使用下面的命令查看是否安装成功当命令行显示如图即为安装成功。_snmp工具