Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Solr in memory?

Tags:

solr

One night I was drinking a pint at a local bar and struck up a conversation with the chap next to me. As it turned out, not only was he a fellow developer, but he also used Solr a lot. As we got to talking about how awesome Solr was, he mentioned something that I've never been able to figure out. He said, "The way to make Solr really perform is to have it run in memory."

Alas, I did not get his name and despite googling for an answer, I've never really found anything concrete. What do you think he meant by this?

like image 754
Jimtronic Avatar asked Oct 26 '11 15:10

Jimtronic


People also ask

How much memory should I allocate to Solr?

Direct memory size can be set using CM (Cloudera Manager->Solr configuration->direct memory). As rule of thumb, the minimum size of direct memory recommended is 8G for a production system if docValues is not used in schema and 12-16G if docValues is used.

How do I start Solr in standalone mode?

Using an External Standalone Server For the installation steps, see the Installation section in Multiple Solr Version Support. # ./bin/solr start -p 8983 Waiting up to 30 seconds to see Solr running on port 8983 [/] Started Solr server on port 8983 (pid=23092). Happy searching!


1 Answers

For anyone looking to do this for the purpose of speeding up tests:

If you have a separate core for your test index, you can change the directoryFactory attribute in solrconfig.xml to:

<directoryFactory name="DirectoryFactory" class="solr.RAMDirectoryFactory"/>

Needless to say, it's not a good idea to keep any production data in memory only.

like image 107
bcoughlan Avatar answered Nov 06 '22 16:11

bcoughlan