The first suspect is garbage collection. There are various tools you can use to monitor GC and see if those times correlate. There's a great intro here: http://www.lucidimagination.com/blog/2011/03/27/garbage-collection-bootcamp-1-0/
But a word of caution when re-executing the queries. It's *possible* that you are getting cached responses when you re-execute the slow ones. Try with a slightly different query (i.e. change one of the query terms to something else). The second thing that could be the culprit is term caching, especially if you're faceting or sorting. Try running your problematical queries after a fresh restart of Solr. If this is a problem, you need to think about autowarming and first/newSearcher options. Best Erick On Wed, Oct 12, 2011 at 10:12 AM, Herman Kiefus <herm...@angieslist.com> wrote: > We service about 25K of each particular query type per hour per server. > QTime *averages* less than a second; however, there always a few (1-10) whose > QTimes go way above (10 - 500 seconds) the average. If I harvest these > queries from the log an re-execute them they of course execute sub-second. > Why are some of these queries running long? > > My first thought was perhaps these queries were occurring subsequent to > replication commits, which happen every 10 minutes; however, there seem to be > no clustering of these events around a 10 minute periodic cycle. (Given that > I have not established any appropriate warming queries, this seemed a logical > conclusion). > > My next though was to compare the times that these queries executed versus > what I see in the log file (grep SEVERE...) But I found nothing to correlate. > > Do you folks have any ideas? >