Neo4j部署在服务器上会闪退的问题
发布于 5 年前 作者 mading0817 4354 次浏览 来自 问答
  1. 服务器用的是阿里云的,1核1G

  2. neo4j(社区版3.5.3)部署在上面后,page cache是128M, max-heap是512M,剩下分给系统

  3. 启动后neo4j在服务器上内存占到82%左右,始终稳定

  4. 在本地打开neo4j desktop后连接都正常,本地电脑:i7 8700k, 16G内存

  5. 库里有3万个节点,7万个关系, 在desktop上做一些查询后,desktop会越来越卡,但内存和cpu占用无增加,无过载,cpu一直就5%左右,内存40%左右

  6. desktop越来越卡,在执行过某个查询后,服务器的neo4j进程会突然关闭,不知是什么原因

  7. 日志下载下来后如下: 2019-03-16 02:22:44.990+0000 INFO ======== Neo4j 3.5.3 ======== 2019-03-16 02:22:45.005+0000 INFO Starting… 2019-03-16 02:22:58.611+0000 INFO Bolt enabled on 0.0.0.0:7687. 2019-03-16 02:23:01.719+0000 INFO Started. 2019-03-16 02:23:03.478+0000 INFO Remote interface available at http://localhost:7474/ 2019-03-16 02:23:13.440+0000 WARN The client is unauthorized due to authentication failure. 2019-03-16 02:24:30.726+0000 WARN The client is unauthorized due to authentication failure. 2019-03-16 02:43:15.058+0000 WARN The client is unauthorized due to authentication failure. 2019-03-16 03:39:01.382+0000 WARN The client is unauthorized due to authentication failure. 2019-03-16 03:39:01.551+0000 WARN The client is unauthorized due to authentication failure. 2019-03-16 04:24:44.032+0000 INFO Neo4j Server shutdown initiated by request 2019-03-16 04:24:44.067+0000 INFO Stopping… 2019-03-16 04:24:44.190+0000 INFO Stopped. nohup: ignoring input OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N 2019-03-16 04:24:54.376+0000 INFO ======== Neo4j 3.5.3 ======== 2019-03-16 04:24:54.410+0000 INFO Starting… 2019-03-16 04:25:06.321+0000 INFO Bolt enabled on 0.0.0.0:7687. 2019-03-16 04:25:09.509+0000 INFO Started. 2019-03-16 04:25:11.577+0000 INFO Remote interface available at http://localhost:7474/ 2019-03-16 04:26:59.813+0000 WARN The client is unauthorized due to authentication failure. 2019-03-17 07:52:54.861+0000 WARN The client is unauthorized due to authentication failure. 2019-03-17 08:14:49.731+0000 WARN The client is unauthorized due to authentication failure.

  8. 16号和17号都有出现neo4j在服务器上闪退的现象,但是日志没有任何关于闪退的记录,3.16号那个stopped是我手动关闭的。

  9. 在浏览器chrome上也会出现越用越卡的现象

如果是服务器配置的问题的话,neo4j占用内存一直稳定在82%左右,cpu也没有过载的现象,因为都是远程连接服务器上的neo4j,为什么本地的浏览器和desktop在经过多次查询后会越来越卡?如果在本地上跑本地的库,从来都没有这些问题,都很好很快。 实在是不知道这是什么问题?还请各位老师,大牛帮帮忙想想办法,看看是咋回事啊。十分感谢!

4 回复

发neo4j.conf文件上来看看。 Neo4j是JAVA开发的,启动后内存是分配给JVM、然后在其中使用,所以从系统内存来看占用比率是稳定的。 闪退的原因要看debug.log和neo4j.log才好判断。不过128M的页缓存和512M的堆内存配少了。 每次查询返回的结果都在浏览器中缓存,因此结果窗口越来越多、浏览器就越来越慢。可以关闭查询结果窗口。

@graphway 后来解决了,因为服务器是1核1G的,把堆内存下调到400,neo4j启动后,jvm占内存在75%以下的时候,就不会出现闪退了。谢谢俞博士!

哦,原来是内存不够分配啊。

想问一下,这个页面缓存和堆内存的分配原则是什么呢。之前看有的人说要越多越好,看样子好像不是这样的,我有一个查询在3台30G内存的因果集群上跑的。执行了2天,还没什么反应,这种情况应该怎么办了,如果应该从cql角度优化的话又应该怎么优化呢

match p=(:People)-[*2…30]->(:People) UNWIND nodes§ as nds WITH sum(nds.times) as sum ,nodes§ as pp RETURN sum,head(pp),size(pp);

回到顶部