8

我正在监视 300 多台服务器,为此我正在使用Ganglia。它RRD用作数据库来收集和存储与每个服务器的资源相关的数据。我想有2年以上的历史,所以看了这篇文章,我觉得我的RRA配置应该是:

RRAs "RRA:AVERAGE:0.5:1:17520"

17520 = (365 天 [年] x 2) * 24 [小时]

这是 Ganglia 默认配置,今天正在运行:

#
# Round-Robin Archives
# You can specify custom Round-Robin archives here (defaults are listed below)
#
# RRAs "RRA:AVERAGE:0.5:1:244" "RRA:AVERAGE:0.5:24:244" "RRA:AVERAGE:0.5:168:244" "RRA:AVERAGE:0.5:672:244" \
#      "RRA:AVERAGE:0.5:5760:374"
#

这是我的思维方式还是我在这里遗漏了什么?

4

1 回答 1

21

在研究了这个主题一段时间后,我想出了一个答案,将来可能会对某人有所帮助。这两篇文章我看了很多遍,推荐。首先阅读这个,创建一个初始 RRD ,然后阅读这个。如何创建 RRDTool 数据库

我将尝试简单地解释它。格式RRA:CF:xff:steps:rows

RRA: Round Robin Archive
CF: Consolidation Factor
XFF: Xfile Factor
steps
rows

steps对我来说最大的问题是发现和的正确值rows。阅读后,我想出了这个解释:

1 day - 5-minute resolution
1 week - 15-minute resolution
1 month - 1-hour resolution
1 year - 6-hour resolution

RRA:AVERAGE:0.5:1:288 \
RRA:AVERAGE:0.5:3:672 \
RRA:AVERAGE:0.5:12:744 \
RRA:AVERAGE:0.5:72:1480

请记住,我们的stepis 300 seconds,所以想法很简单:如果我想解析one daywhich has 86400 seconds,如第一个示例所示,我需要多少行?答案是288 rows。为什么?

`86400 seconds [1 day] / 300 seconds [5 minutes`] = 288 rows

另一个例子,如果我想解决:
1 周[ = 604800 seconds ]15 分钟[ = 900 seconds ]= 604800/900 =672 rows

其他值也是如此。这样你就可以知道rows你需要多少。找出steps你需要多少是非常简单的,你只需要采取你的步骤的乘数。

让我解释一下:我们steps300 seconds,对吧?

所以如果我们想解决 5 minutes [ = 300 seconds ],我们只需要乘以 1 ,对吗?因此,15 分钟意味着 300 秒 x 3,1 小时意味着 300 x 12,6 小时意味着 300 x 72 等等。

在我的具体情况下,我想steps成为30 seconds,所以我想出了这些结构:

1   every time           30 seconds      1 * 30s = 30s
2   every second time     1 minute       2 * 30s = 1m
4   every third time      2 minutes      4 * 30s = 2m
10  every 10th time       5 minutes     10 * 30s = 5m
20  every 20th time      10 minutes     20 * 30s = 10m
60  every 60th time      30 minutes     60 * 30s = 30m
80  every 80th time      40 minutes     80 * 30s = 40m
100 every 100th time     50 minutes    100 * 30s = 50m
120 every 120th time      1 hour       120 * 30s = 1h
240 every 240th time      2 hours      240 * 30s = 2h
360 every 360th time      3 hours      360 * 30s = 3h

RRA:AVERAGE:0.5:1:120 \
RRA:AVERAGE:0.5:2:120 \
RRA:AVERAGE:0.5:4:120 \
RRA:AVERAGE:0.5:10:288 \
RRA:AVERAGE:0.5:20:1008 \
RRA:AVERAGE:0.5:60:1440 \
RRA:AVERAGE:0.5:80:3240 \
RRA:AVERAGE:0.5:100:5184 \
RRA:AVERAGE:0.5:120:8760 \
RRA:AVERAGE:0.5:240:8760 \
RRA:AVERAGE:0.5:360:8760 \

意思是:

1 hour    -  30 seconds  resolution
2 hours   -  1 minute    resolution
4 hours   -  2 minutes   resolution
1 day     -  5 minutes   resolution
1 week    - 10 minutes   resolution
1 month   - 30 minutes   resolution
3 months  - 40 minutes   resolution
6 months  - 50 minutes   resolution
1 year    -  1 hour      resolution
2 year    -  2 hour      resolution
3 year    -  3 hour      resolution

好吧,我希望这对某人有所帮助,仅此而已。

于 2013-04-04T14:19:17.610 回答