Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling Solr read and write timeout exception

Tags:

java

solr

solrj

I am new to solr. I have developed a an website which uses solr for indexing. I want to handle the timeouts that can occur during solr read and write index.Please guide me on how can i handle these exceptions. I am using solrj as solr client and my website and solr server are running on the tomcat.

Thnak you!

like image 214
azhar_salati Avatar asked May 10 '10 07:05

azhar_salati


1 Answers

Commit and Optimize are operations to make updates available to searchers. They are intended to be run after updates, not before queries.

Furthermore, they are expensive operations, which is why you're getting sporadical timeouts. Unless you have some special requirements, I recommend setting the <autoCommit/> option in your solrconfig.xml. As the name says, it will automatically issue the commit depending on configurable criteria like maximum number of uncommitted documents or maximum time after adding documents.

Optimize is even more expensive than Commit, it basically rewrites the index. The frequency of an Optimize depends on how often you Commit changes and how many changes there are per commit.

See also:

  • SOLR commit and optimize questions
  • http://wiki.apache.org/solr/SolrPerformanceFactors#Updates_and_Commit_Frequency_Tradeoffs
  • http://wiki.apache.org/solr/SolrConfigXml#Update_Handler_Section
like image 90
Mauricio Scheffer Avatar answered Sep 21 '22 01:09

Mauricio Scheffer