2011-06-17 63 views
1

我需要知道EmbeddedSolrServer和CommonsHttpSolrServer之间的性能。CommonsHttpSolrServer有很好的性能吗?

EmbeddedSolrServer: -

File home = new File("C:\\workspace\\SolrWithMultipleCore\\solr"); 
File f = new File(home, "solr.xml"); 
CoreContainer container = new CoreContainer(); 
container.load("C:\\workspace\\SolrMultipleCore\\solr", f); 
EmbeddedSolrServer server = new EmbeddedSolrServer(container,"core1"); 
EmbeddedSolrServer server1 = new EmbeddedSolrServer(container,"core2"); 
String query=params.getParams("q"); 
String query1=params.getParams("q1"); 
SolrQuery solrquery=new SolrQuery(query); 
QueryResponse rsp1 = server.query(solrquery); 
QueryResponse rsp2 = server1.query(solrquery); 

CommonsHttpSolrServer: -

SolrServer httpServer = new CommonsHttpSolrServer(url); 
QueryResponse rsp1=httpServer.query(q); 
SolrServer httpServer1 = new CommonsHttpSolrServer(url1); 
QueryResponse rsp2=httpServer1.query(q1); 

哪一个是最好EmbeddedSolrServer或CommonsHttpSolrServer?我意思的两个核心有不同的模式。 我需要知道什么是MultiThreadedHttpConnectionManager。

在此先感谢...

+0

通常推荐使用solr专用服务器。它可以扩展,适合大多数用例。参考:“我应该何时使用嵌入式Solr”在书籍“Solr 1.4 Enterprise Search Server” – chro 2011-06-22 16:08:35

回答

5

嵌入显然更快,因为它没有任何HTTP或序列化开销。这并不意味着你应该总是使用嵌入式。请参阅EmbeddedSolr wiki page

关于MultiThreadedHttpConnectionManager的CommonHttpSolrServer javadocs解释:

客户端 连接管理器应该是一个 MultiThreadedHttpConnectionManager如果 这个客户正在跨越 SolrServer情况下重复使用,或多种的 线程将使用这个SolrServer 。

+0

如果可能的话,请在MultiThreadedHttpConnectionManager上添加一些示例或者链接它描述的内容?谢谢你的帮助。 – 2011-06-17 14:39:43

+0

@Syed:http://lucene.472066.n3.nabble.com/questions-on-CommonsHttpSolrServer-and-MultiThreadedHttpConnectionManager-td837695.html – 2011-06-17 14:52:52

+0

你能帮我加入我吗?如果可能的话 – 2011-06-22 07:05:30