Heap memory Solr and Elasticsearch

344 Views Asked by At

I'm just reading the book Mastering Apache Solr and the writer recommends to set the minimum heap size (-Xms) to 2GB and the maximum heap size (-Xmx) to 12GB.

Is 2GB necessary? I just use a 512MB server (which is low, I know) for Solr and I found it already useful. Only sometimes indexing fails, probably because of that. We don't have 100.000 records yet, but it already helps with a quick and powerful search engine.

But... I just got started with Solr, so I just want to ask:

  • Can I use Solr with a couple of GB memory?
  • Does an alternative like Elasticsearch use less memory?

Just want to save money as much as possible, and I didn't read about the memory usage earlier. As far as I read here Solr is a better choice for us because we use it mainly for text-search. But if any of you have any better advice, I would like to hear so :)

1

There are 1 best solutions below

1
On BEST ANSWER

Solr heap size must be set according your business. Set -Xms=2G and -Xmx=12G is just a recommendation to lots of popular Solr applications but it's not mandatory. You need to assess your requirements and set the heap to work well for you. I really recommend you to use at least 2G on heap. There is a part of heap used by Solr just to maintains the server up and 512m probably will not be enough.