Neo4j 插入大文件 - 之间的时间差异很大

Neo4j inserting large files - huge difference in time between

我正在我的数据库中插入一组文件(pdf,每个 2 MB)。 一次插入 100 个文件需要 +- 15 秒,而一次插入 250 个文件需要 80 秒。

我不太清楚为什么会出现这么大的差异,但我认为这是因为在此数量之间的可用内存量已满。这可能是问题所在吗? 如果我可以提供更详细的信息,请告诉我。

不完全确定你这边发生了什么,但它确实看起来像 neo4j 性能指南中描述的here

可能是:

内存问题

If you are experiencing poor write performance after writing some data (initially fast, then massive slowdown) it may be the operating system that is writing out dirty pages from the memory mapped regions of the store files. These regions do not need to be written out to maintain consistency so to achieve highest possible write speed that type of behavior should be avoided.

交易规模

您是否使用多次交易上传文件?

Many small transactions result in a lot of I/O writes to disc and should be avoided. Too big transactions can result in OutOfMemory errors, since the uncommitted transaction data is held on the Java Heap in memory.

如果您使用 linux,他们还建议进行一些调整以提高性能。参见 here

您可以在页面上查看详情。

此外,如果您在 linux,您可以在导入过程中使用以下命令自行检查内存使用情况:

$ free -m

希望对您有所帮助!