在研究了这个主题一段时间后,我想出了一个答案,将来可能会对某人有所帮助。这两篇文章我看了很多遍,推荐。首先阅读这个,创建一个初始 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
请记住,我们的step
is 300 seconds
,所以想法很简单:如果我想解析one day
which 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
你需要多少是非常简单的,你只需要采取你的步骤的乘数。
让我解释一下:我们steps
是300 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
好吧,我希望这对某人有所帮助,仅此而已。