【发布时间】:2015-04-24 22:07:05
【问题描述】:
就我而言,我需要为设备捕获 15 个性能指标并将其保存到 InfluxDB。每个设备都有一个唯一的设备 ID。
Metrics 通过以下方式写入 InfluxDB。这里我只展示一个作为例子
new Serie.Builder("perfmetric1")
.columns("time", "value", "id", "type")
.values(getTime(), getPerf1(), getId(), getType())
.build()
写入数据既快速又简单。但是当我运行查询时,我发现性能很差。我正在尝试获取过去一小时的所有 15 个指标值。
select value from perfmetric1, perfmetric2, ..., permetric15
where id='testdeviceid' and time > now() - 1h
一个小时内,每个指标有 120 个数据点,总共有 1800 个数据点。在 c4.4xlarge EC2 实例空闲时,查询大约需要 5 秒。
我相信 InfluxDB 可以做得更好。这是我的架构设计的问题,还是其他问题?将查询拆分为 15 个并行调用会更快吗?
【问题讨论】:
标签: time-series influxdb