neo4j相同查询语句一次查询特慢再次查询比较快。

现象:

neo4j相同查询语句一次查询特慢再次查询比较快。

分析:

查询语句

bash 复制代码
//查询同名方法
  match(path:Method)
where id(path) in [244333030] and NOT path:Constructor

//是rpc的方法
 match(rpc_method:Method)<-[:DECLARES]-(rpc_method_cls:Class)
-[:ANNOTATED_BY]->(anno:Annotation)
-[:OF_TYPE]->(annoType:Type{fqn:'com.yueyue.wukong.rpc.annotation.RpcProvider'})
 where rpc_method.signature = path.signature


return * limit 10

profile查看真实的执行过程。explain 可以查看预估的计划任务

bash 复制代码
profile match(path:Method)
where id(path) in [244333030] and NOT path:Constructor

//是rpc的方法
 match(rpc_method:Method)<-[:DECLARES]-(rpc_method_cls:Class)
-[:ANNOTATED_BY]->(anno:Annotation)
-[:OF_TYPE]->(annoType:Type{fqn:'com.yueyue.wukong.rpc.annotation.RpcProvider'})
 where rpc_method.signature = path.signature


return * limit 10

过滤行数最多才16行,理论不应该慢。

升级配置,修改neo4j内存配置

分析服务器监控, cpu 磁盘压力比较高。

尝试升级服务器配置到64G

修改neo4j 内存配置

dbms.memory.heap.initial_size=2G

dbms.memory.heap.max_size=10G

dbms.memory.pagecache.size=30g 原来是2G

最终解决问题。

neo4j 内存大小评估方法参考文档:

https://neo4j.com/developer/kb/how-to-estimate-initial-memory-configuration/

相关推荐
清水白石0082 天前
深入 Python 的底层世界:从 C 扩展到 ctypes 与 Cython 的本质差异全解析
c语言·python·neo4j
TGITCIC3 天前
讲透知识图谱Neo4j在构建Agent时到底怎么用(二)
人工智能·知识图谱·neo4j·ai agent·ai智能体·大模型落地·graphrag
TGITCIC4 天前
讲透知识图谱Neo4j在构建Agent时到底怎么用(一)
知识图谱·neo4j·ai agent·智能体·图搜索·ai智能体·graphrag
菜鸟冲锋号4 天前
从零搭建高可用GraphRAG系统:LangChain+Neo4j+FAISS+Qwen-7B实战指南
langchain·neo4j·faiss
一车小面包7 天前
Neo4j中的APOC
算法·neo4j
人工小情绪8 天前
python报错:AttributeError: module ‘numpy‘ has no attribute ‘object‘.
python·numpy·neo4j
Java后端的Ai之路9 天前
【神经网络基础】-TensorFlow Serving官方的生产级模型部署
神经网络·部署·tensorflow·neo4j·tensorflowserv
咋吃都不胖lyh17 天前
Neo4j 知识讲解与在线工具使用教程
neo4j
麦麦大数据18 天前
F056 知识图谱飞机问答系统
人工智能·flask·vue·问答系统·知识图谱·neo4j·飞机
麦麦大数据19 天前
F054-基于Vue+Flask+Neo4j构建的移民知识图谱可视化分析系统
vue.js·flask·知识图谱·neo4j·移民分析