我刚从版本1.4
转到2.1.1
并注意到了改进,但插入速度非常慢,随着插入更多文档,变慢。
我正在从旧数据库迁移到new并一次插入1000。以下是一些供您细读的日志:
========= [26.28s]
BATCH #1 [0s]
========= [0s]
CREATED: 1000 [0s]
UPDATED: 0 [0s]
SUBTOTAL: 1000 [0s]
BATCH TIME: 26.279s [0s]
TOTAL BATCH TIME: 26.279s [0s]
AVG TIME PER BATCH: 26.279s [0s]
TOTAL TIME: 29.277s [0s]
========= [29.919s]
BATCH #2 [0.001s]
========= [0s]
CREATED: 2000 [0s]
UPDATED: 0 [0s]
SUBTOTAL: 2000 [0s]
BATCH TIME: 29.919s [0s]
TOTAL BATCH TIME: 56.198s [0s]
AVG TIME PER BATCH: 28.099s [0s]
TOTAL TIME: 61.341s [0s]
========= [33.698s]
BATCH #3 [0s]
========= [0s]
CREATED: 3000 [0s]
UPDATED: 0 [0s]
SUBTOTAL: 3000 [0s]
BATCH TIME: 33.697s [0s]
TOTAL BATCH TIME: 89.89500000000001s [0s]
AVG TIME PER BATCH: 29.965000000000003s [0s]
TOTAL TIME: 97.755s [0s]
========= [62.653s]
BATCH #10 [0s]
========= [0s]
CREATED: 10000 [0s]
UPDATED: 0 [0s]
SUBTOTAL: 10000 [0s]
BATCH TIME: 62.653s [0s]
TOTAL BATCH TIME: 438.422s [0s]
AVG TIME PER BATCH: 43.842200000000005s [0s]
TOTAL TIME: 474.096s [0s]
我使用ArangoDB NodeJS API并运行以下代码(每批1000次):
db.document.create("users", user)
这里是否有我遗漏的东西,或者ArangoDB对于任何包含> 1000条记录的数据库都是错误的原因?
答案 0 :(得分:1)
请查看您收藏的“waitForSync”属性。 我已经使用waitForSync,创建了1000个文档并使用nodejs驱动程序进行arango:
waitForSync true 13,3 s
waitForSync false 0,5 s