首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >对于大数据集,neo4j真的需要大内存大小吗?

对于大数据集,neo4j真的需要大内存大小吗?
EN

Stack Overflow用户
提问于 2015-02-25 23:41:24
回答 1查看 207关注 0票数 1

当前的数据是节点存储几乎有65 we的数据,以及260 we的关系存储?

在生产过程中,期望200个用户同时使用该应用程序,这在幕后触发了neo4j查询。我通过了neo4j计算器,推荐使用64G内存。

目前,我测试的中间阶段有3台RHEL服务器,每个服务器都有8G内存,而4G已分配给java堆。它有HDD而不是SSD。每台服务器有两个cpu核心。

作为一个单一的用户,简单的查询带来了快速,和一些复杂的,必须运行更大的数据节点在20秒内运行。它运行良好,直到2到3个用户。但是过了一段时间,结果将不返回,查询将不确定地运行。

我不确定这类数据的预期系统配置是什么,管理层希望证明对更高系统采购的要求是合理的。

是否有可能,此配置可以调整以支持生产负载。

我已经按照neo4j站点中的建议做了性能调整,从linux性能到内存缓存性能参数。

还是需要更大的RAM将所有关系加载到内存中,使查询和并发负载具有更快的响应速度?

有疑问的查询

代码语言:javascript
复制
match (c:company) 
where c.company IN [ "GENERAL ELECTRIC-TELEPRESENCE","PNOC_REG02","testzenos2","testzenos3","PT10","CMSP_SLT_SYNC","CMSP_SLT_SYNC_2","Smoke Test Company","PTrans-Regr","SPWIFI-POC","PNOC_REG01","IBM","MERAKISP-MERAKICUST","0101rms","Meraki_SP01-new3" ] 

match (c)-[r1]->(s:physical_location)-[r5]->(im:im_tkt) 
where ( 
   ( im.assigned_group_id IN [ "SGP000000000259" ] and im.company = "GENERAL ELECTRIC-TELEPRESENCE") 
OR ( im.assigned_group_id IN [ "SGP000000000259" ] and im.company = "PNOC_REG02") 
OR ( im.assigned_group_id IN [ "SGP000000000259","SGP000000000175" ] and im.company = "testzenos2") 
OR ( im.assigned_group_id IN [ "SGP000000000259","SGP000000000175" ] and im.company = "testzenos3") 
OR ( im.assigned_group_id IN [ "SGP000000000259","SGP000000000088" ] and im.company = "PT10") 
OR ( im.assigned_group_id IN [ "SGP000000000175","SGP000000000088" ] and im.company = "CMSP_SLT_SYNC") 
OR ( im.assigned_group_id IN [ "SGP000000000175","SGP000000000088" ] and im.company = "CMSP_SLT_SYNC_2") 
OR ( im.assigned_group_id IN [ "SGP000000000088" ] and im.company = "Smoke Test Company") 
OR ( im.assigned_group_id IN [ "SGP000000000088" ] and im.company = "PTrans-Regr") 
OR ( im.assigned_group_id IN [ "SGP000000000088" ] and im.company = "SPWIFI-POC") 
OR ( im.assigned_group_id IN [ "SGP000000000088" ] and im.company = "PNOC_REG01") 
OR ( im.assigned_group_id IN [ "SGP000000000088" ] and im.company = "IBM") 
OR ( im.assigned_group_id IN [ "SGP000000000088" ] and im.company = "MERAKISP-MERAKICUST") 
OR ( im.assigned_group_id IN [ "SGP000000000088" ] and im.company = "0101rms") 
OR ( im.assigned_group_id IN [ "SGP000000000088" ] and im.company = "Meraki_SP01-new3") ) 

RETURN collect(distinct(im.incident_number)) as im_tkt__incident_number , 
       collect(distinct(im.company)) as im_tkt__company , 
       collect(distinct(im.assigned_support_organization)) as im_tkt__assigned_support_organization , 
       collect(distinct(im.assignee)) as im_tkt__assignee , 
       collect(distinct(im.description)) as im_tkt__description , 
       collect(distinct(im.priority)) as im_tkt__priority , 
       collect(distinct(im.status)) as im_tkt__status , 
       collect(distinct(im.impact)) as im_tkt__impact , 
       collect(distinct(im.entryid_TS1)) as im_tkt__entryid_TS1;

这是运行时间较长的查询。

EN

回答 1

Stack Overflow用户

发布于 2015-02-28 12:51:49

您是否创建了索引或约束?

代码语言:javascript
复制
create index on :company(company);
create index on :im_tkt(assigned_group_id);

在你真正的程序中使用参数!!

输入如下所示的param地图列表:

代码语言:javascript
复制
[{company:"GENERAL ELECTRIC-TELEPRESENCE", 
  assigned_group_ids:[ "SGP000000000259" ]}, 
...]

然后查询:

代码语言:javascript
复制
UNWIND {param} as pair
MATCH (c:company {company:pair.company})-[r1]->(s:physical_location)-[r5]->(im:im_tkt)
WHERE im.assigned_group_id IN pair.assigned_group_ids
RETURN collect(distinct(im.incident_number)) as im_tkt__incident_number , 
       collect(distinct(im.company)) as im_tkt__company , 
       collect(distinct(im.assigned_support_organization)) as im_tkt__assigned_support_organization , 
       collect(distinct(im.assignee)) as im_tkt__assignee , 
       collect(distinct(im.description)) as im_tkt__description , 
       collect(distinct(im.priority)) as im_tkt__priority , 
       collect(distinct(im.status)) as im_tkt__status , 
       collect(distinct(im.impact)) as im_tkt__impact , 
       collect(distinct(im.entryid_TS1)) as im_tkt__entryid_TS1;

用于测试,您可以使用

代码语言:javascript
复制
UNWIND [{company:"GENERAL ELECTRIC-TELEPRESENCE", assigned_group_ids:[ "SGP000000000259" ]}] as pair
MATCH (c:company {company:pair.company})-[r1]->(s:physical_location)-[r5]->(im:im_tkt)
WHERE im.assigned_group_id IN pair.assigned_group_ids
RETURN ...
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28731905

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档