Re: Ping handler during initial wamup

2014-09-22 Thread William Bell
I put in a fix a long time ago, so it wouldn't be too hard to redo.

1. Send 500 error until core  0 numFound.
2. Give it a list of cores.

localhost:8983/solr/ping?check=core1,core2,core3

Then the Amazon load balancer can just check this url with HTTP check


On Thu, Sep 18, 2014 at 3:57 AM, Ere Maijala ere.maij...@helsinki.fi
wrote:

 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.


 Thanks, I've filed https://issues.apache.org/jira/browse/SOLR-6532.

 --Ere




-- 
Bill Bell
billnb...@gmail.com
cell 720-256-8076


Re: Ping handler during initial wamup

2014-09-18 Thread Ere Maijala

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.


Thanks, I've filed https://issues.apache.org/jira/browse/SOLR-6532.

--Ere



Ping handler during initial wamup

2014-09-17 Thread Ere Maijala
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.


--Ere


Re: Ping handler during initial wamup

2014-09-17 Thread Shawn Heisey
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



Re: Ping handler during initial wamup

2014-09-17 Thread Shawn Heisey
On 9/17/2014 8:07 PM, Shawn Heisey wrote:
 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.

At the URL below, you can see a trimmed version of my haproxy config.
I've got more than I show here, but this is the part that handles my
main Solr index:

http://apaste.info/0vk

The ncmain core is a core that has no index, with the shards parameter
built into the config, so the application has no idea that it's talking
to a sharded index that actually lives on two separate servers.

Thanks,
Shawn