在数据库重启期间保留 Neo4j 页面缓存
自 Neo4j 3.4 起,基于 PR 10957,在使用 Neo4j Enterprise 时,Neo4j 页面缓存将在数据库重启后得以保留,因此可能不再需要预热页面缓存。
由于该 PR 的影响,每隔 60 秒我们会记录 Neo4j 页面缓存的页面,并将这些数据存储在 graph.db/profile。该目录的内容类似于
$ ls -al
total 80
drwxrwxr-x 2 neo4j neo4j 4096 Apr 18 12:12 .
drwxrwxr-x 6 neo4j neo4j 4096 Apr 18 12:06 ..
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.counts.db.a.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 18 12:11 neostore.counts.db.b.cacheprof
-rw-rw-r-- 1 neo4j neo4j 24 Apr 19 08:31 neostore.labelscanstore.db.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.labeltokenstore.db.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.labeltokenstore.db.names.cacheprof
-rw-rw-r-- 1 neo4j neo4j 28 Apr 19 08:31 neostore.nodestore.db.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.nodestore.db.labels.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.propertystore.db.arrays.cacheprof
-rw-rw-r-- 1 neo4j neo4j 29 Apr 19 08:31 neostore.propertystore.db.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.propertystore.db.index.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.propertystore.db.index.keys.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.propertystore.db.strings.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.relationshipgroupstore.db.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.relationshipstore.db.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.relationshiptypestore.db.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.relationshiptypestore.db.names.cacheprof
-rw-rw-r-- 1 neo4j neo4j 21 Apr 19 08:31 neostore.schemastore.db.cacheprof
由于每个文件都是表示给定文件哪些页面位于内存中的 gzip 压缩位图(即每个 8 KiB 页面对应一个位),我们预计上述文件的体积会保持相对较小。
此外,graph.db/profiles 会被纳入备份,因此在恢复并启动 Neo4j 时,页面缓存将根据备份时的缓存状态重新加载。
此页面有帮助吗?