Ganglia 网络流量监控的异常数据

48 views
Skip to first unread message

Bojie Li

unread,
Mar 25, 2014, 1:05:24 PM3/25/14
to USTC_LUG
Inline image 1

几个月以来,Ganglia 监控总是有一些上图所示的情况,经查是 RRD database 中保存了异常数据。正常情况下,19 秒的 bytes_in/out 大概是 1e+07 量级,pkts_in/out 大概是 1e+04 量级,但经常有一些高达 1e+16/1e+17 的异常数据。这些数据的 pkts_in 和 bytes_in 总是相等或者很接近,显然每个包一个字节是不可能的,因此一定是数据收集过程中出了问题(是溢出吗?)。几乎每台被监控的主机都有一些这样的异常数据,但除网络以外的其他指标没有发现异常数据。

大家在使用网络监控工具的过程中是否遇到过异常数据问题?是否有办法在 rrdtool 画图的时候通过参数,过滤掉这些异常数据?

$ rrdtool dump /var/lib/ganglia/rrds/blog/blog.ustc.edu.cn/pkts_in.rrd |grep '2014-03-25'|grep 'e+16\|e+17'          
                        <!-- 2014-03-25 21:31:50 CST / 1395754310 --> <row><v>2.7669225918e+17</v></row>
                        <!-- 2014-03-25 21:32:00 CST / 1395754320 --> <row><v>4.6115376531e+17</v></row>
                        <!-- 2014-03-25 21:32:10 CST / 1395754330 --> <row><v>4.6115376531e+17</v></row>
                        <!-- 2014-03-25 21:32:20 CST / 1395754340 --> <row><v>4.6115376531e+17</v></row>
                        <!-- 2014-03-25 21:32:30 CST / 1395754350 --> <row><v>1.8446150612e+17</v></row>
                        <!-- 2014-03-25 21:32:00 CST / 1395754320 --> <row><v>1.8446150612e+17</v></row>
                        <!-- 2014-03-25 21:32:40 CST / 1395754360 --> <row><v>2.7669225918e+17</v></row>
                        <!-- 2014-03-25 21:33:20 CST / 1395754400 --> <row><v>4.6115376531e+16</v></row>

$ rrdtool dump /var/lib/ganglia/rrds/blog/blog.ustc.edu.cn/bytes_in.rrd |grep '2014-03-25'|grep 'e+16\|e+17'
                        <!-- 2014-03-25 21:31:50 CST / 1395754310 --> <row><v>2.7669225919e+17</v></row>
                        <!-- 2014-03-25 21:32:00 CST / 1395754320 --> <row><v>4.6115376531e+17</v></row>
                        <!-- 2014-03-25 21:32:10 CST / 1395754330 --> <row><v>4.6115376531e+17</v></row>
                        <!-- 2014-03-25 21:32:20 CST / 1395754340 --> <row><v>4.6115376531e+17</v></row>
                        <!-- 2014-03-25 21:32:30 CST / 1395754350 --> <row><v>1.8446150613e+17</v></row>
                        <!-- 2014-03-25 21:32:00 CST / 1395754320 --> <row><v>1.8446150614e+17</v></row>
                        <!-- 2014-03-25 21:32:40 CST / 1395754360 --> <row><v>2.7669225919e+17</v></row>
                        <!-- 2014-03-25 21:33:20 CST / 1395754400 --> <row><v>4.6115376550e+16</v></row>

bytes_out 和 pkts_out 也是很相近甚至完全相同的异常值。

Zhang Cheng

unread,
Mar 26, 2014, 12:59:47 AM3/26/14
to USTC LUG
​我们碰到过异常数据,不过是从交换机读出来的(通过snmp),交换机吐出来的数据就是这么大,我们也不知道为啥。对于Linux系统数据,ganglia是从/proc/net/dev读取的,这里面的数据按理说不会那么容易溢出(应该是64位的计数器,有待验证)。我们现在不怎么用ganglia了,以前用ganglia时没有碰到过主机带宽有噪点的。使用collectd时,也没有碰到过,collectd也是读取/proc/net/dev来采集数据的。

​​ganglia使用的代码
​这里:
https://github.com/ganglia/monitor-core/blob/master/libmetrics/linux/metrics.c#L259
​​
ganglia在遇到溢出时,以前是用ULONG_MAX来减,后来改成STAT_MAX,我估计lug线上用的版本应该还是ULONG_MAX的。如果是用ULONG_MAX来减,那么这么大的数字就可以理解了。

--
Cheng,
Best Regards

Bojie Li

unread,
Mar 26, 2014, 1:58:23 AM3/26/14
to USTC_LUG
那你们是如何处理这些噪点的呢?是修改 gmetad 不把检测到的噪点插入数据库,还是发现问题后人肉修改 RRD database,还是在 rrdtool 画图的时候忽略掉这些噪点?我最希望是最后一种,不动原始数据,但没找到办法。


--
-- 来自USTC LUG
请使用gmail订阅,不要灌水。
更多信息more info:http://groups.google.com/group/ustc_lug?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "USTC_LUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ustc_lug+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zhang Cheng

unread,
Mar 26, 2014, 2:06:17 AM3/26/14
to USTC LUG

2014-03-26 13:58 GMT+08:00 Bojie Li <boj...@gmail.com>:
那你们是如何处理这些噪点的呢?是修改 gmetad 不把检测到的噪点插入数据库,还是发现问题后人肉修改 RRD database,还是在 rrdtool 画图的时候忽略掉这些噪点?我最希望是最后一种,不动原始数据,但没找到办法。

​我们也没找到方法。。。好在有噪点的数据都在一个方向上,且这个方向的数据我们不关心,我就直接不画这个方向的数据。。。​

从rrdtool的帮助文件看,画图时可以指定limits相关的参数来调整纵轴比例:



--
Cheng,
Best Regards

Bojie Li

unread,
Apr 3, 2014, 8:27:14 AM4/3/14
to USTC_LUG
现在 status.lug.ustc.edu.cn 网络流量的噪点消失了。

观察到这些噪点的数值都在 1e+15 以上,而且正常的数值都没有这么大,因此用了 dirty 的做法:修改 rrdtool 源码,把 1e+15 以上的值在画图时去掉。

Based on rrdtool 1.4.7, in src/rrd_graph.c, function data_proc:

1286a1287,1291
> #define RRD_DATA_FILTER_THRESHOLD 1.0e+15
>               if (value > RRD_DATA_FILTER_THRESHOLD) {
>                   value = DNAN;
>               }
>


--
Reply all
Reply to author
Forward
0 new messages