On 9/17/2014 7:06 AM, Ere Maijala wrote: > As far as I can see, when a Solr instance is started (whether > standalone or SolrCloud), a PingRequestHandler will wait until index > warmup is complete before returning (at least with > useColdSearcher=false) which may take a while. This poses a problem in > that a load balancer either needs to wait for the result or employ a > short timeout for timely failover. Of course the request is eventually > served, but it would be better to be able to switch over to another > server until warmup is complete. > > So, is it possible to configure a ping handler to return quickly with > non-OK status if a search handler is not yet available? This would > allow the load balancer to quickly fail over to another server. I > couldn't find anything like this in the docs, but I'm still hopeful. > > I'm aware of the possibility of using a health state file, but I'd > rather have a way of doing this automatically.
If it's not horribly messy to implement, returning a non-OK status immediately when there is no available searcher seems like a good idea. Please file an improvement issue in Jira. This can be handled on the load balancer end by configuring a quick timeout on load balancer health checks, and doing them very frequently. I've got haproxy in front of my solr servers. My checks happen every five seconds, with a 4990 millisecond timeout. My ping handler query (defined in solrconfig.xml) is "q=*:*&rows=1" ... so it's very simple and fast. Because of efficiencies in the *:* query and caching, I doubt this is putting much of a load on Solr. It would probably be acceptable to do the health checks once a second, although with typical Solr logging configs you'd end up with a LOT of log data. If you configure logging at the WARN level, this would not be a worry. Thanks, Shawn