0

I have a 2.2GB solr core which responds extremely well after running the indexing process via DataImportHandler. I noticed that solr uses a considerable amount of ram while doing that.

The problem comes after I reboot the machine. Query time increases to 200 - 300ms and used ram is very low.

So can you please give me a hint on what can I try to reach the same perfomance I have after indexing even after machine reboot?

Thank you!

  • Try warming up your cache By hitting up frequently used queries. – Bipul Jain Apr 07 '17 at 09:43
  • Thanks! But that would apply only for those queries. The rest of them will still have a increased response time. Plus you have to build a cache warming script for that. I am wondering if some sort of command exists which I can run and the index will be moved into memory just as it is after the full-import is made. – Serbu Florin-Adrian Apr 07 '17 at 09:59

2 Answers2

1

if you reboot the machine, the index files will be cold, that is, not cached by the OS.

So, if you have enough free ram to load the whole index in it, you can use a script like this:

find $PATH_TO_YOUR_INDEX_DATA_DIR/data/ -type f -exec cat {} \; > /dev/null

Do this before starting solr. Your index is only 2.2GB so this should be fairly quick.

Persimmonium
  • 15,593
  • 11
  • 47
  • 78
0

When talking about Solr performance and caches we need to clearly differentiate between :

  1. OS File Memory Mapping of indexed files This caching happens outside solr and it is fundamental to have fast performances. More your index is cached in memory, faster search will be ( this part is managed by the OS)

  2. Solr Caching To warm up Solr Caches on startup , you must configure the firstSearcher warming queries, they may be generic or quite specific, depending on the use case. They may be configured for the firstSearcher ( on Solr startup) and for the newSearcher ( everytime a commit implies opening a new Searcher).