The first thing I'd do is run your query with &debguQuery=on and look at the "timings" section. That'll tell you what component is taking all the time and should help you figure out where the problem is....
But worst-case you could implement a custom component to stop processing after some set number of responses.. 2.5M docs isn't a very big index. So I'd look at the rest of the tuning knobs before jumping to a solution. Also be aware that the first time, for instance, a sort gets performed there's a lengthy hit for warming the caches so you should disregard the first few queries, or do appropriate autowarming. Best Erick On Wed, Aug 29, 2012 at 1:26 PM, Aleksey Vorona <avor...@ea.com> wrote: > Hi, we are running Solr 3.6.1 and see an issue in our load tests. Some of > the queries our load test script produces result in huge number of hits. It > may go as high as 90% of all documents we have (2.5M). Those are all range > queries. I see in the log that those queries take much more time to execute. > > Since such a query does not make any sense from the end user perspective, I > would like to limit its performance impact. > > Is it possible to abort the query after certain number of document hits or > certain time elapsed and return a error? I would render that error as > "Please refine your search" message to the end user in my application. I > know that many sites on the web do that, and I guess most of them do that > with Solr. > > I tried setting timeAllowed limit, but, for some reason, I did not see those > query times to go down. I suspect that most of the time is spent not in > Search phase (which is the only one respecting timeAllowed, as far as I > know), but in the sorting phase. And still, I want to abort any longer > running query. Otherwise they accumulate over time, pushing server's load > average sky high and killing performance even for regular queries. > > -- Aleksey