2010-10-20 99 views
3

我在我的數據庫中看到極其緩慢的Solr更新。該數據庫只有900個文件。我們在一段時間自動提交使用自動提交以下設置,一旦是需要長時間阻塞更新:Solr更新很慢

<autoCommit> 
    <maxDocs>10000</maxDocs> 
    <maxTime>1000</maxTime> 
</autoCommit> 

世界上有什麼可以發生74秒900頁的文件。

想法?

這裏是日誌片段:

2010年10月18日上午十一時52分46秒org.apache.solr.core.SolrCore執行 INFO:[] web應用=/solr的路徑= /更新PARAMS = { }狀態= 0 QTIME = 59569 2010年10月18日上午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 AM o rg.apache.solr.update.processor.LogUpdateProcessor完成

2010年10月18日上午11點54分40秒org.apache.solr.core.SolrCore執行 INFO:[] web應用=/solr的路徑= /更新PARAMS = {}狀態= 0 QTIME = 76098 2010年10月18日上午11點54分41秒org.apache.solr.update.DirectUpdateHandler2提交

和提交日誌:

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

INFO:開始提交(優化= F ALSE,waitFlush =真,waitSearcher =真)

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

INFO:打開搜索器@ 29b003主

年10月18 2010年上午11時54分00秒org.apache.solr.update.DirectUpdateHandler2提交

信息:end_commit_flush

2010年10月18日上午11時54分00秒org.apache.solr.search.SolrIndexSearcher溫暖

INFO:autowarming 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:用於autowarming結果Searcher @ 29b003 main 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,c umulative_inserts = 3207537,cumulative_evictions = 3184094}

2010年10月18日上午11點54分20秒org.apache.solr.search。SolrIndexSearcher溫暖

INFO:autowarming搜索器@從搜索器29b003主@ 718c93主 queryResultCache {查找= 0,命中= 0,hitratio = 0.00,插入= 256,驅逐= 0,大小= 256,warmupTime = 18604,cumulative_lookups = 3084,cumulative_hits = 996,cumulative_hitratio = 0.32,cumulative_inserts = 2313,cumulative_evictions = 0}

2010年10月18日上午11點54分四十零秒org.apache.solr.search.SolrIndexSearcher溫暖

INFO: searchcher @ 29b003主要 queryResultCache {lookups = 0,hit = 0,hitratio = 0.00,inserts = 256,逐出= 0,size = 256,warmupTime = 19925,cumulative_查找= 3084,cumulative_hits = 996,cumulative_hitratio = 0.32,cumulative_inserts = 2313,cumulative_evictions = 0}

2010年10月18日上午11時五十四分40秒org.apache.solr.search.SolrIndexSearcher溫暖

INFO :autowarming搜索器@ 29b003 main來自Searcher @ 718c93 main documentCache {lookups = 0,hit = 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}

二零一零年十月十八日上午11時54分40秒org.apache.solr.search.SolrIndexSearcher溫暖

INFO:authowarming for Searcher @ 29b003主結果 documentCache {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}

二○一○年十月一十八日上午十一點54分40秒org.apache.solr.core.SolrCore registerSearcher

INFO:[]註冊新搜索者搜索者@ 29b003主

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

+0

取決於Solr需要做什麼樣的分析......你可以發佈你的schema.xml嗎? – 2010-10-20 15:43:47

+0

這沒什麼特別的 - 每個文檔有十幾個字段。 5個方面。 – user43685 2010-10-20 23:55:26

+0

有趣的是,有一個搜索者有很大的熱身時間,爲什麼會這樣呢? – user43685 2010-10-20 23:58:40

回答

7

隨着<maxTime>1000</maxTime>,你將在每秒鐘提交一次。每次Solr進行提交時,都會發生以下幾件事情:索引搜索器關閉並重新打開,緩存與舊緩存一起加熱,一些查詢可能會自動啓動(請參閱solrconfig中的'newSearcher'設置) 。在某個時候,你可能會有重疊的提交。如果發生這種情況,Solr通常會很慢。

所以問問自己,你是否真的需要在每一秒做出承諾。如果是的話,那麼從'newSearcher'中刪除所有查詢可能會更好,因爲承諾經常導致它們無用。

+0

我認爲在提交之前數據不可用於搜索。所以邏輯就是經常以不同步的方式應用少量變化。其次,我認爲DirectUpdateHandler2似乎連續處理更新請求(包括提交) - 不重疊。 – user43685 2010-10-20 23:56:39

+0

爲什麼? 「邏輯是經常異步地應用少量變化」 - >這是實時的,在正常情況下絕對沒有必要。對於你的第二個問題:問題是索引需要一段時間+加熱查詢(如果cachesize!= 0)=>你會得到很多updaters =>很快達到thos更新的最大值=>性能瓶頸!只需設置1000到60000 – Karussell 2010-11-03 10:33:57

+1

這應該是被接受的答案。或者,您可以從執行更新的代碼執行手動提交(SolrServer.commit())。那麼不需要自動提交。 – Frans 2012-10-11 07:24:12