你好,有以下几个问题:
1,索引和tag或edge的分布情况是什么?每个tag或edge大概附属了几个索引?
2,24小时持续入库的过程中有高峰期吗?时间曲线大概什么样?
3,目前的大概数据量是多少?
索引写入慢的原因有三个:
1, 写入数据增大了,多一个索引就需要多写一份数据。
2,写入索引的过程中,为了保证索引与数据的一致性,需要一边查询一边写入,例如upsert操作,需要删除旧索引插入新索引。这一系列操作都是在原子操作中完成。
3,当大量数据写入后,可能一些数据是无序的,这时会影响上边第2点的查询操作,经过测试,带索引的情况下,bulk insert 时会有性能衰减的情况,这个时候如果做一次compact,性能就可以恢复。
以下是之前在单机ssd存储下做的一个测试,供参考:
--total_vertices_size=2000000
============================================================================
src/storage/test/StorageIndexWriteBenchmark.cpprelative time/iter iters/s
============================================================================
withoutIndex 5.85s 170.92m
unmatchIndex 6.23s 160.60m
attachIndex 20.57s 48.61m
duplicateVerticesIndex 1.01min 16.56m
multipleIndex 1.03min 16.20m
============================================================================
--total_vertices_size=1000000
============================================================================
src/storage/test/StorageIndexWriteBenchmark.cpprelative time/iter iters/s
============================================================================
withoutIndex 2.75s 364.19m
unmatchIndex 3.52s 284.10m
attachIndex 8.39s 119.24m
duplicateVerticesIndex 23.06s 43.37m
multipleIndex 26.67s 37.50m
============================================================================
--total_vertices_size=100000
============================================================================
src/storage/test/StorageIndexWriteBenchmark.cpprelative time/iter iters/s
============================================================================
withoutIndex 249.19ms 4.01
unmatchIndex 262.50ms 3.81
attachIndex 755.14ms 1.32
duplicateVerticesIndex 1.77s 564.09m
multipleIndex 1.23s 813.10m
============================================================================
--total_vertices_size=10000
============================================================================
src/storage/test/StorageIndexWriteBenchmark.cpprelative time/iter iters/s
============================================================================
withoutIndex 24.60ms 40.65
unmatchIndex 28.94ms 34.55
attachIndex 70.85ms 14.11
duplicateVerticesIndex 162.35ms 6.16
multipleIndex 142.78ms 7.00
============================================================================
--total_vertices_size=1000
============================================================================
src/storage/test/StorageIndexWriteBenchmark.cpprelative time/iter iters/s
============================================================================
withoutIndex 2.97ms 336.30
unmatchIndex 4.19ms 238.76
attachIndex 10.24ms 97.65
duplicateVerticesIndex 19.40ms 51.55
multipleIndex 19.13ms 52.29
============================================================================
**/