TSDB之KairosDB:Tag对性能的影响测试
命题1:是否可以不断增加标签?
命题2:标签值的值域对KairosDB的性能有多大影响?
命题3:应该选择多少标签较为合适?
其它总结
总结1:每增加一个标签,rowkey增加标签key=value的字符串长度
总结2:标签与值,应当选择与时间无关的属性
总结3:kairosdb应进行改进,避免write failed无返回值
总结4:cassandra与kairosdb在windows平台无法充分利用机器性能
总结5:rowkey的查询原理及租户或指标间的影响性
- 接收查询参数:指标、时间范围、标签范围、汇聚参数
- 根据“指标与时间范围”,生成rowkey_range_start与rowkey_range_end
- 向cassandra查询rowkey_range_start与rowkey_range_end间的所有rowkey,生成match1_rowkeys
- 针对match1_rowkeys进行计算,分析是否包含了“标签范围”中指定的标签,将包含的rowkeys,生成match2_rowkeys
- 根据match2_rowkeys查询数据,并根据“汇聚参数”进行汇聚与返回
由于上述step3 cassandra可以快速的利用集群能力查询出所在范围段内的rowkey,所以这里的成本很低,大的成本在于step 4,这里需要大量的数据contains计算。
- 指标数量增加,影响非常小,因为step3的成本很低
- 时间的增加,影响非常小,因为step3的成本很低
- 标签组合出来的值域越大,性能越低。因为导致step4的成本较高
测试方案与数据
序号 | 标签数 | 标签组合 | 测试次数 | 写入TPS | 读取TPS | rowkey长度 |
---|---|---|---|---|---|---|
1 | 3 | 1. TagPolicy{key='tagkkkkkkkkkkkkk1', value='tagvvvvvvvvvvvv0~10'} 2. TagPolicy{key='tagkkkkkkkkkkkkk2', value='tagvvvvvvvvvvvv0~30'} 3. TagPolicy{key='tagkkkkkkkkkkkkk3', value='tagvvvvvvvvvvvv0~1000'} | 3 | 33406 | 1.55 | 148 |
2 | 6 | 1. TagPolicy{key='tagkkkkkkkkkkkkk1', value='tagvvvvvvvvvvvv0~10'} 2. TagPolicy{key='tagkkkkkkkkkkkkk2', value='tagvvvvvvvvvvvv0~30'} 3. TagPolicy{key='tagkkkkkkkkkkkkk3', value='tagvvvvvvvvvvvv0~1000'} 4. TagPolicy{key='tagkkkkkkkkkkkkk4', value='tagvvvvvvvvvvvv0~10'} 5. TagPolicy{key='tagkkkkkkkkkkkkk5', value='tagvvvvvvvvvvvv0~10'} 6. TagPolicy{key='tagkkkkkkkkkkkkk6', value='tagvvvvvvvvvvvv0~10'} | 2 | 26860 | 0.95 | 无 |
3 | 9 | 1. TagPolicy{key='tagkkkkkkkkkkkkk1', value='tagvvvvvvvvvvvv0~10'} 2. TagPolicy{key='tagkkkkkkkkkkkkk2', value='tagvvvvvvvvvvvv0~30'} 3. TagPolicy{key='tagkkkkkkkkkkkkk3', value='tagvvvvvvvvvvvv0~1000'} 4. TagPolicy{key='tagkkkkkkkkkkkkk4', value='tagvvvvvvvvvvvv0~10'} 5. TagPolicy{key='tagkkkkkkkkkkkkk5', value='tagvvvvvvvvvvvv0~10'} 6. TagPolicy{key='tagkkkkkkkkkkkkk6', value='tagvvvvvvvvvvvv0~10'} 7. TagPolicy{key='tagkkkkkkkkkkkkk7', value='tagvvvvvvvvvvvv0~10'} 8. TagPolicy{key='tagkkkkkkkkkkkkk8', value='tagvvvvvvvvvvvv0~10'} 9. TagPolicy{key='tagkkkkkkkkkkkkk9', value='tagvvvvvvvvvvvv0~10'} | 1 | 23610 | 0.8 | 364 |
4 | 4 | 1. TagPolicy{key='tagkkkkkkkkkkkkk1', value='tagvvvvvvvvvvvv0~10', uniqure=true} 2. TagPolicy{key='tagkkkkkkkkkkkkk2', value='tagvvvvvvvvvvvv0~30', uniqure=true} 3. TagPolicy{key='tagkkkkkkkkkkkkk3', value='tagvvvvvvvvvvvv0~1000', uniqure=true} 4. TagPolicy{key='tagkkkkkkkkkkkkk4', value='tagvvvvvvvvvvvv0~300000', uniqure=false} | 1 | 26065 | 无 | 无 |
5 | 3 | 1. TagPolicy{key='tagkkkkkkkkkkkkk1', value='tagvvvvvvvvvvvv0~1000', uniqure=true} 2. TagPolicy{key='tagkkkkkkkkkkkkk3', value='tagvvvvvvvvvvvv0~30000', uniqure=false} 3. TagPolicy{key='tagkkkkkkkkkkkkk2', value='tagvvvvvvvvvvvv0~300', uniqure=true} | 1 | 28841 | 1.1 | 154 |
相关文章