Solr更新非常慢

use*_*685 3 lucene solr

我在我的数据库中看到极慢的Solr更新.该数据库只有900个文件.我们使用具有以下设置的自动提交,并且偶尔自动提交需要很长时间阻止更新:

<autoCommit> 
  <maxDocs>10000</maxDocs>
  <maxTime>1000</maxTime>
</autoCommit>
Run Code Online (Sandbox Code Playgroud)

使用900个文档,世界上可以发生74秒的事情.

想法?

这是日志片段:

2010年10月18日上午11:52:46 org.apache.solr.core.SolrCore执行INFO:[] webapp =/solr path =/update params = {} status = 0 QTime = 59569 Oct 18,2010 11:52:上午46点org.apache.solr.update.SolrIndexWriter getDirectory

2010年10月18日上午11:53:21 org.apache.solr.core.SolrCore执行INFO:[] webapp =/solr path =/update params = {} status = 0 QTime = 33586 Oct 18,2010 11:53: 21日上午org.apache.solr.update.processor.LogUpdateProcessor完成

2010年10月18日上午11:54:40 org.apache.solr.core.SolrCore执行INFO:[] webapp =/solr path =/update params = {} status = 0 QTime = 76098 2010年10月18日11:54:凌晨41点org.apache.solr.update.DirectUpdateHandler2提交

并提交日志:

2010年10月18日上午11:54:00 org.apache.solr.update.DirectUpdateHandler2提交

信息:开始提交(optimize = false,waitFlush = true,waitSearcher = true)

2010年10月18日上午11:54:00 org.apache.solr.search.SolrIndexSearcher

信息:开放搜索者@ 29b003主要

2010年10月18日上午11:54:00 org.apache.solr.update.DirectUpdateHandler2提交

信息:end_commit_flush

2010年10月18日上午11:54:00 org.apache.solr.search.SolrIndexSearcher温暖

信息:autararming Searcher @ 29b003 main来自Searcher @ 718c93 main filterCache {lookups = 0,hits = 0,hitratio = 0.00,inserts = 512,evictions = 0,size = 257,warmupTime = 19294,cumulative_lookups = 3330661,cumulative_hits = 12 5437 ,cumulative_hitratio = 0.03,cumulative_inserts = 3207537,cumulative_evictions = 3184094}

2010年10月18日上午11:54:20 org.apache.solr.search.SolrIndexSearcher温暖

INFO:Searcher @ 29b003的过滤结果主要filterCache {lookups = 0,hits = 0,hitratio = 0.00,inserts = 256,evictions = 0,size = 256,warmupTime = 19739,cumulative_lookups = 3330661,cumulative_hits = 12 5437,cumulative_hitratio = 0.03,cumulative_inserts = 3207537,cumulative_evictions = 3184094}

2010年10月18日上午11:54:20 org.apache.solr.search.SolrIndexSearcher温暖

INFO:autararming Searcher @ 29b003 main来自Searcher @ 718c93 main queryResultCache {lookups = 0,hits = 0,hitratio = 0.00,inserts = 256,evictions = 0,size = 256,warmupTime = 18604,cumulative_lookups = 3084,cumulative_hits = 996, cumulative_hitratio = 0.32,cumulative_inserts = 2313,cumulative_evictions = 0}

2010年10月18日上午11:54:40 org.apache.solr.search.SolrIndexSearcher温暖

INFO:Searcher @ 29b003主要查询结果缓存结果:查找结果缓存结果缓存结果查询结果:查找结果查询结果查询结果显示搜索结果,cumulative_inserts = 2313,cumulative_evictions = 0}

2010年10月18日上午11:54:40 org.apache.solr.search.SolrIndexSearcher温暖

信息:自动装配Searcher @ 29b003主要来自Searcher @ 718c93主文件缓存{lookups = 0,hits = 0,hitratio = 0.00,inserts = 0,evictions = 0,size = 0,warmupTime = 0,cumulative_lookups = 41846,cumulative_hits = 33712, cumu lative_hitratio = 0.80,cumulative_inserts = 8134,cumulative_evictions = 0}

2010年10月18日上午11:54:40 org.apache.solr.search.SolrIndexSearcher温暖

信息:Searcher @ 29b003主文档的自动装配结果缓存{lookups = 0,hits = 0,hitratio = 0.00,inserts = 0,evictions = 0,size = 0,warmupTime = 0,cumulative_lookups = 41846,cumulative_hits = 33712,cumu lative_hitratio = 0.80,cumulative_inserts = 8134,cumulative_evictions = 0}

2010年10月18日上午11:54:40 org.apache.solr.core.SolrCore registerSearcher

信息:[]注册新的搜索者Searcher @ 29b003 main

2010年10月18日上午11:54:40 org.apache.solr.search.SolrIndexSearcher关闭

Pas*_*imo 7

有了<maxTime>1000</maxTime>,你会在每一秒都有一个提交.每次Solr执行提交时,都会发生以下几种情况:索引搜索器已关闭并重新打开,缓存使用旧缓存加热,一些查询可能会自动启动(查看solrconfig中的'newSearcher'设置) .在某些时候,您可能会有重叠提交.如果发生这种情况,Solr通常会很慢.

因此,问问自己是否真的需要在每一秒都有提交.如果是的话,最好从'newSearcher'中删除所有查询,因为提交它经常会使它们变得无用.