Solr service not responding occasionally

514 views
Skip to first unread message

DavidHog

unread,
Dec 29, 2011, 8:14:07 AM12/29/11
to php-sol...@googlegroups.com
We've been using Solr in development with SolrPhpClient and it works very well.

We're running Apache/Zend with Solr under Tomcat5 and most of the time it's fine. But every now and then, normally after some period of no usage, say overnight, we get a message back 'Solr service not responding'. A simple F5 gets the pages running again.

We've taken the 'ping'out of our code as the ping already happens in the Service.php. Looking at the Tomcat access logs, we see only 200 responses fom the ping. Looking at the Apache logs, we see only 200 responses from the queries to Tomcat, yet we still get this message.

Has anyone else seen this or have any idea where the message comes from?

Cheers,

DavidHog

Donovan Jimenez

unread,
Dec 29, 2011, 5:21:32 PM12/29/11
to php-sol...@googlegroups.com
Since you see a connection timeout on the first request after a long idle period, it hints to me it might be memory related. Your system might be paging out memory needed for tomcat and the solr webapp during the idle phase, and then when during the first request there's a longer handling period as it brings everything back in. but that's just a weak guess for you to test out.

If having the solr results as part of the page request is more important than the overall page loading time - meaning you feel it better to take 5 - 10 seconds than to have no results at all in a failure mode - then I'd suggest setting your connection timeout to a larger value.

you can change the default timeout for all requests with (value is in seconds)

$solr = new Apache_Solr_Service();
$solr->setDefaultTimeout(5.0);

Another thing to try might be something to make requests to your server periodically, to keep it less idle over time. In my own use of Solr I'm load balancing over several read slaves using IPVS, as part of the ldirector configuration it actually checks the health of each slave with a ping request every 5 minutes. A similar periodic health check might be prudent for your systems anyway.

Hope this helps in some way, let us know if you hunt down a specific reason for the slow first request.

- Donovan
> --
> You received this message because you are subscribed to the Google Groups "PHP Solr Client" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/php-solr-client/-/zd5BGfPX6IYJ.
> To post to this group, send email to php-sol...@googlegroups.com.
> To unsubscribe from this group, send email to php-solr-clie...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/php-solr-client?hl=en.
>
Reply all
Reply to author
Forward
0 new messages