rails - tire - elasticsearch : need to restart elasticsearch server

心不动则不痛 提交于 2019-12-25 05:27:17

问题


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.

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:


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.



来源:https://stackoverflow.com/questions/17344460/rails-tire-elasticsearch-need-to-restart-elasticsearch-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!