rails - tire - elasticsearch : need to restart ela

2019-09-18 06:43发布

I use rails - tire - elasticsearch, everything is mainly working very well, but just from time to time, my server start to be very slow. So I have to restart elasticsearch service and then everything go fine again.

graph from newrelic

I have impression that it happens after bulk inserts (around 6000 products). Can it be linked? Inserts last like 2 min max, but still after server has problem

EDIT : finally it is not linked to bulk inserts

I have only this line in log

[2013-06-29 01:15:32,767][WARN ][monitor.jvm              ] [Jon Spectre] [gc][ParNew][26438][9941] duration [3.4s], collections [1]/[5.2s], total [3.4s]/[57.7s], memory [951.6mb]->[713.7mb]/[989.8mb], all_pools {[Code Cache] [10.6mb]->[10.6mb]/[48mb]}{[Par Eden Space] [241.1mb]->[31mb]/[273mb]}{[Par Survivor Space] [32.2mb]->[0b]/[34.1mb]}{[CMS Old Gen] [678.3mb]->[682.6mb]/[682.6mb]}{[CMS Perm Gen] [35mb]->[35mb]/[166mb]}

Does someone understand this ?

1条回答
可以哭但决不认输i
2楼-- · 2019-09-18 07:03

This is just stabbing in the dark, but from what you report, there might be a bad memory setting for your java virtual machine.

ElasticSearch is built with Java and so runs on a JVM. Each JVM process has a defined set of memory to allocate when you start it up. When the available memory is not enough, it crashes, so it has to do garbage collection to free up space. When you run a Java process on the memory limit, it is occupied with a lot of GC runs and will get very slow.

You can have a look at the java jmx management console for what the process is doing and how much memory it has.

查看更多
登录 后发表回答