我有一个qr为2-3(毫秒)的solr查询。然而,响应时间约为5秒。
显然,问题似乎是将数据从solr发送到我的应用程序,但如果查询时间是2毫秒,响应只有~500kb,则不应该花费5秒。
是否可能有一个码头设置来增加缓冲量?或者在某处设置solr?
编辑(solrconfig.xml):
<config>
<luceneMatchVersion>4.7</luceneMatchVersion>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
<dataDir>/etc/solr/default/solr/${solr.core.name}/data</dataDir>
<schemaFactory class="ClassicIndexSchemaFactory"/>
<updateHandler class="solr.DirectUpdateHandler2">
<updateLog>
<str name="dir">/etc/solr/default/solr/${solr.core.name}/data</str>
</updateLog>
</updateHandler>
<requestHandler name="/get" class="solr.RealTimeGetHandler">
<lst name="defaults">
<str name="omitHeader">true</str>
</lst>
</requestHandler>
<requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
<requestDispatcher handleSelect="true" >
<requestParsers enableRemoteStreaming="false" multipartUploadLimitInKB="2048" formdataUploadLimitInKB="2048" />
</requestDispatcher>
<requestHandler name="standard" class="solr.StandardRequestHandler" default="true" />
<requestHandler name="/analysis/field" startup="lazy" class="solr.FieldAnalysisRequestHandler" />
<requestHandler name="/update" class="solr.UpdateRequestHandler" />
<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
<lst name="invariants">
<str name="q">solrpingquery</str>
</lst>
<lst name="defaults">
<str name="echoParams">all</str>
</lst>
</requestHandler>
<!-- term vector -->
<searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
<requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="df">text</str> <!-- config for the admin interface -->
<bool name="tv">true</bool>
</lst>
<arr name="last-components">
<str>tvComponent</str>
</arr>
</requestHandler>
<!-- more like this -->
<searchComponent name="mlt" class="solr.MoreLikeThisComponent" />
<requestHandler name="/mlt" class="solr.MoreLikeThisHandler" />
<!-- config for the admin interface -->
<admin>
<defaultQuery>solr</defaultQuery>
</admin>
<!-- caches -->
<query>
<filterCache class="solr.FastLRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<!-- Query Result Cache -->
<queryResultCache class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<!-- Document Cache -->
<documentCache class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
</query>
</config>
干杯
答案 0 :(得分:0)
您确定在服务器上花了5秒钟吗?如果您还没有这样做,一个有用的测试是从Solr管理界面触发查询并使用调试器(例如firebug)来确定等待和接收所花费的网络时间。
过去我也有一些代理问题,如果你正在使用它,虽然这导致没有响应而不是延迟。