我们使用 solr 作为全文搜索器。我们在 solr 中使用多核,我们有大约 5 亿条数据。我们在达到 1000 条新记录时批量更新索引而不提交它们,因为我们在 solr 中使用自动提交。最近,当我们批量发布新记录时,cpu 使用率下降到 100%。我已经转储了高 cpu 的头。大多数线程喜欢如下:
java.lang.Thread.State: RUNNABLE
at org.apache.lucene.search.ConjunctionTermScorer.doNext(ConjunctionTermScorer.java:64)
at org.apache.lucene.search.ConjunctionTermScorer.nextDoc(ConjunctionTermScorer.java:95)
at org.apache.lucene.search.Scorer.score(Scorer.java:63)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:605)
at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:297)
at org.apache.solr.search.SolrIndexSearcher.getDocSetNC(SolrIndexSearcher.java:1060)
at org.apache.solr.search.SolrIndexSearcher.getPositiveDocSet(SolrIndexSearcher.java:763)
at org.apache.solr.search.SolrIndexSearcher.getProcessedFilter(SolrIndexSearcher.java:880)
at org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1337)
at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1304)
at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:395)
at org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:410)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:208)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1797)
at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:637)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:343)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:141)