免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3128 | 回复: 5
打印 上一主题 下一主题

从ganglia流量图异常追查到现在,开始怀疑是内核问题了。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-04-28 14:07 |只看该作者 |倒序浏览
本帖最后由 weichongli 于 2010-04-28 14:37 编辑

2010-04-26 11:31

如下图, 注意单位是P



经过分析,是由于gmond收集数据时,经常由于一些我没找到的原因而得出了一个异常的大数。

ganglia的开发人员也意识到了这个问题,他们认为是硬件错误导致的,并在libmetrics/linux/metrics.c提供了如下修正:
  1. #ifdef REMOVE_BOGUS_SPIKES
  2. /*
  3. ** Check for "invalid" data, caused by HW error. Throw away dubious data points
  4. ** FIXME: This should be done per-interface, with threshholds depending on actual link speed
  5. */
  6. if ((l_bin > 1.0e13) || (l_bout > 1.0e13) ||
  7. (l_pin > 1.0e8)  || (l_pout > 1.0e8)) {
  8. err_msg("update_ifdata(%s): %g %g %g %g / %g",caller,l_bin,l_bout,l_pin,l_pout,t);
  9. return;
  10. }
  11. #endif
复制代码
但是默认情况下,这个修正并未被激活,需要在编译时使用

make CFLAGS=-DREMOVE_BOGUS_SPIKES

来将这段代码编译进ganglia的二进制程序

观察中……

论坛徽章:
0
2 [报告]
发表于 2010-04-28 14:09 |只看该作者
2010.04.26 21:52 续:
今天中午又蹦出来一个……虽然是T级别的,但仍然不行。

见下图



考虑到目前我们单台Server流量不会超过2Gbps,临时修改了部分代码(ganglia-3.1.7)

  1. diff metrics.c metrics.c.ori
  2. 219d218
  3. <               //TODO add log "%index %dev RxB TxB %dev RxB TxB"
  4. 231,232c230
  5. <             //debug_msg("update_ifdata(%s) - Overflow in rbi: %lu -> %lu",caller,ns->rbi,rbi);
  6. <             err_msg("update_ifdata(%s) - Overflow in rbi: %lu -> %lu",caller,ns->rbi,rbi);
  7. ---
  8. >             debug_msg("update_ifdata(%s) - Overflow in rbi: %lu -> %lu",caller,ns->rbi,rbi);
  9. 241,242c239
  10. <             //debug_msg("updata_ifdata(%s) - Overflow in rpi: %lu -> %lu",caller,ns->rpi,rpi);
  11. <             err_msg("updata_ifdata(%s) - Overflow in rpi: %lu -> %lu",caller,ns->rpi,rpi);
  12. ---
  13. >             debug_msg("updata_ifdata(%s) - Overflow in rpi: %lu -> %lu",caller,ns->rpi,rpi);
  14. 255,256c252
  15. <             //debug_msg("update_ifdata(%s) - Overflow in rbo: %lu -> %lu",caller,ns->rbo,rbo);
  16. <             err_msg("update_ifdata(%s) - Overflow in rbo: %lu -> %lu",caller,ns->rbo,rbo);
  17. ---
  18. >             debug_msg("update_ifdata(%s) - Overflow in rbo: %lu -> %lu",caller,ns->rbo,rbo);
  19. 265,266c261
  20. <             //debug_msg("update_ifdata(%s) - Overflow in rpo: %lu -> %lu",caller,ns->rpo,rpo);
  21. <             err_msg("update_ifdata(%s) - Overflow in rpo: %lu -> %lu",caller,ns->rpo,rpo);
  22. ---
  23. >             debug_msg("update_ifdata(%s) - Overflow in rpo: %lu -> %lu",caller,ns->rpo,rpo);
  24. 297,298c292
  25. < //     if ((l_bin > 1.0e13) || (l_bout > 1.0e13) ||
  26. <      if ((l_bin > 2.5e8) || (l_bout > 2.5e8) ||
  27. ---
  28. >      if ((l_bin > 1.0e13) || (l_bout > 1.0e13) ||
  29. 300,304c294
  30. <         err_msg("update_ifdata(%s): %lu %g, %lu %g, %lu %g, %lu %g / %g", caller,
  31. <             l_bytes_in, l_bin,
  32. <             l_bytes_out, l_bout,
  33. <             l_pkts_in, l_pin,
  34. <             l_pkts_in, l_pout,t);
  35. ---
  36. >         err_msg("update_ifdata(%s): %g %g %g %g / %g",caller,l_bin,l_bout,l_pin,l_pout,t);
复制代码
本来想每次统计时都计算一次当前机器的激活的网卡数量来做一个上限(例如2块千M网卡,一块全速,另一块接了百M线,总量是1.1Gbps),特意从 ethtool的源代码中抽取出一部分做了一个测试,但发现这种方式需要root权限。root权限是一定不会用的,另开一个进程反而增加了整个方案的复杂度只能放弃这个诱人的打算

单靠丢弃不合理数据不是个根本的解决办法,应该弄清楚错误数据是怎么产生的。继续观察,明天有时间再修改一下,把所有日志都加进去。

论坛徽章:
0
3 [报告]
发表于 2010-04-28 14:14 |只看该作者
本帖最后由 weichongli 于 2010-04-28 14:21 编辑

2010.04.28 13:45 续

还是不行……我加了一个函数,把每次检查时的update_file()读取到的/proc/net/dev文件记录下来,出问题时,在/var/log/message的3个时间点有如下记录

Apr 27 23:19:13 hostname /opt/ganglia/sbin/gmond[18465]: update_ifdata(BO) - Overflow in rbo: 304634803029227 -> 630666266 [1272381553]
Apr 27 23:20:13 hostname /opt/ganglia/sbin/gmond[18465]: update_ifdata(BO) - Overflow in rbi: 10458900526801464705 -> 38016437180368 [1272381613]
Apr 27 23:20:13 hostname /opt/ganglia/sbin/gmond[18465]: update_ifdata(BO) - Overflow in rpo: 219388676028 -> 219365592250 [1272381613]


在对应的时间点/proc/net/dev记录的内容如下:

------------------ 1272381433.117603 -----------------
Inter-|   Receive                                                |  Transmit
face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
lo:3143390051 39831988    0    0    0     0          0         0 3143390051 39831988    0    0    0     0       0          0
tunl0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
eth0:38015520377153 135587033135    0 8587116    0     0          0         6 304631801519418 219359254753    0    0    0     0       0          0
eth1:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

------------------ 1272381493.118502 -----------------
Inter-|   Receive                                                |  Transmit
face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
lo:3143407797 39832216    0    0    0     0          0         0 3143407797 39832216    0    0    0     0       0          0
tunl0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
eth0:38015973907827 135588437010    0 8587116    0     0          0         6 304634803029227 219361451245    0    0    0     0       0          0
eth1:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

------------------ 1272381553.121013 -----------------
Inter-|   Receive                                                |  Transmit
face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
lo:3143407797 39832216    0    0    0     0          0         0 3143407797 39832216    0    0    0     0       0          0
tunl0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
eth0:10458900526801464705 135564674293    0 8587116    0     0          0 219363599555 630666266 219388676028 7723    0    0     0    7723          0
eth1:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

------------------ 1272381613.123535 -----------------
Inter-|   Receive                                                |  Transmit
face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
lo:3143444605 39832676    0    0    0     0          0         0 3143444605 39832676    0    0    0     0       0          0
tunl0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
eth0:38016437180368 135590918375    0 8587116    0     0          0         6 304640653909921 219365592250    0    0    0     0       0          0
eth1:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0


难道这是个内核BUG? (2.6.20)我觉得这个不应该是硬件问题吧

论坛徽章:
0
4 [报告]
发表于 2010-04-28 14:17 |只看该作者
在1272381553这个时间点出了一个很异常的数,在下一时间点又恢复正常

论坛徽章:
0
5 [报告]
发表于 2010-04-28 18:58 |只看该作者
貌似我发错版块了……谁能帮我移个位置?

论坛徽章:
0
6 [报告]
发表于 2010-04-29 17:46 |只看该作者
嗯……问题定位了

broadcom网卡驱动模块bnx2有问题~
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP