0

pysolr is taking time first time after the solr restart. Scenario is like this. 1)Restart Solr server 2)Execute the query directly in solr is taking 4 sec 3)when we are trying to execute the same query using pysolr, it is taking 300 seconds or more for the first time. After refreshing it is taking only less than 2 sec.

When I check the pysolr code the time is taking in the below code.

resp = requests_method(url, data=bytes_body, headers=headers, files=files,
                                   timeout=self.timeout, auth=self.auth)

4)Can anybody help me in getting the out faster first time also. I think this abnormal because executing the query directly in Solr is taking very few seconds.

Hector Correa
  • 26,290
  • 8
  • 57
  • 73
Joji
  • 1
  • 1
  • Have you tried adjusting the timeout? It seems like since pysolr has lost connection to Solr or Zookeeper, it spends far too long to find out that the connection has been lost. Are you using the solr cloud mode (i.e. through zookeeper urls), or are you using standalone? – MatsLindh Aug 27 '21 at 12:32
  • Hi MatsLindh, Thanks for your quick support, I am using Solr only and planning to move to solr cloud from next month. my question is why pysolr is taking huge time to connect to solr first time. Is there any possiblilty of reduce this time? I have given connection time out as 300 sec. Apart from this, is there any way to mention the timeout between pysolr and Solr. – Joji Aug 27 '21 at 13:19
  • I found the issue. This is happening when we include one facet called Author name which is having huge data (200 Million). There are total 16 facets are there. only this facet is showing issue. second time onwards this facet also loading smoothly. Need to find a solution for this.... – Joji Aug 28 '21 at 02:48
  • See https://stackoverflow.com/questions/21565988/solr-is-slow-at-first-facet-query-but-quite-fast-for-later-queries/21566447 - you should configure a warmup query so that the caches are already warmed up when your queries start hitting Solr. It won't really help with restarts, but it'll help with any spikes seen after commits and indexing. – MatsLindh Aug 28 '21 at 07:39

0 Answers0