简体   繁体   English

定制Solr以进行优化

[英]Customizing Solr for optimization

I am newbie to java but an expert in lamp. 我是Java的新手,但是灯的专家。 I am using solr for my search requirement. 我正在使用solr进行搜索。

However i need to perform a real time search for online user + some criteria. 但是,我需要对在线用户+一些条件进行实时搜索。

Current implementation: I am sending all online user ids (+ offcourse other search criteria) in post request which is very slow. 当前实现:我在发帖请求中发送所有在线用户ID(+离线其他搜索条件),这非常慢。

To overcome this i must do some internal code changes. 为了克服这个问题,我必须进行一些内部代码更改。

Can someone guide me how to go about this change and is there any tutorial available 有人可以指导我如何进行此更改吗?有没有可用的教程

Optimizing Solr is very easy. 优化Solr非常容易。 In fact Solr guys have themselves come up with a wiki page for boosting performance of Solr . 实际上,Solr家伙们自己想出了一个维基页面来提高Solr的性能

You can tune Solr in several ways. 您可以通过多种方式调整Solr。 The basic tuning you should be looking at are as below: 您应该查看的基本调优如下:

  • Optimize Java params passed to Solr eg: -Xmx2048m -Xms512m”(2G/512M) 优化传递给Solr的Java参数,例如: -Xmx2048m -Xms512m”(2G/512M)
  • Tune the hardware which matches the requirement. 调整符合要求的硬件。
  • Configure enough SolrCache which is required. 配置足够的SolrCache ,这是必需的。
  • Move Zookeeper , if using, to another disk. Zookeeper (如果使用)移动到另一个磁盘。 If the index is huge then number of I/O call from Solr to - Zookeeper will degrade the assembly performance. 如果索引很大,则从Solr到Zookeeper的I / O调用次数将降低程序集性能。
  • Increase the Zookeeper timeout period. 增加Zookeeper超时时间。
  • Log GC times, I found out pauses of upto 20s on Zookeeper boxes. 记录GC时间,我发现Zookeeper盒子上的停顿时间长达20 Zookeeper
  • Optimize Solr search Queries. 优化Solr搜索查询。
  • Use the recommendations to tune the heap from http://wiki.apache.org/solr/ShawnHeisey#GC_Tuning 使用建议从http://wiki.apache.org/solr/ShawnHeisey#GC_Tuning调整堆

Also, Have a look at the guide to Solr performance tuning . 另外,请参阅Solr性能调整指南

But, in the end, do remember that Solr is not intended for real time search. 但是,最后请记住,Solr并非用于实时搜索。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM