I went ahead and patched locally the SolrQueryParser in current 3_x branch. Doing a quick test, baring any obvious mistake due to sleep deprivation I get close to a 10X performance boost from 200qps to 2000qps.
I opened https://issues.apache.org/jira/browse/SOLR-2493 cheers, -- stephane On Tue, May 3, 2011 at 1:45 PM, Stephane Bailliez <sbaill...@gmail.com> wrote: > I' m using Solr 3.1 right now. > > I was looking at a threadump trying to figure out why queries were not > exactly fast and noticed that it keeps parsing xml over and over from > the schema to get the lucene version. > > SolrQueryParser are created for each request and in the constructor > there is a call similar to > > getSchema().getSolrConfig().getLuceneVersion("luceneMatchVersion", > Version.LUCENE_24) > > which calls getVal() which is calling getNode() which creates a new > XPath object which ends up creating a new object factory which ends up > loading a class... > > I cannot find a reference to this issue anywhere in jira nor google. > Hard to see right now how much effect that does have, but this seems > not quite optimal to do for every request. > > Am I missing something obvious here ? > > The stack looks like: > > java.lang.Thread.State: BLOCKED (on object monitor) > at > org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:369) > - waiting to lock <0x00002aaab3bb43b0> (a > org.mortbay.jetty.webapp.WebAppClassLoader) > at > org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363) > at > com.sun.org.apache.xml.internal.dtm.ObjectFactory.findProviderClass(ObjectFactory.java:506) > at > com.sun.org.apache.xml.internal.dtm.ObjectFactory.lookUpFactoryClass(ObjectFactory.java:217) > at > com.sun.org.apache.xml.internal.dtm.ObjectFactory.createObject(ObjectFactory.java:131) > at > com.sun.org.apache.xml.internal.dtm.ObjectFactory.createObject(ObjectFactory.java:101) > at > com.sun.org.apache.xml.internal.dtm.DTMManager.newInstance(DTMManager.java:135) > at > com.sun.org.apache.xpath.internal.XPathContext.<init>(XPathContext.java:100) > at > com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:201) > at > com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:275) > at org.apache.solr.core.Config.getNode(Config.java:230) > at org.apache.solr.core.Config.getVal(Config.java:256) > at org.apache.solr.core.Config.getLuceneVersion(Config.java:325) > at > org.apache.solr.search.SolrQueryParser.<init>(SolrQueryParser.java:76) > at > org.apache.solr.schema.IndexSchema.getSolrQueryParser(IndexSchema.java:277) > at > org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:76) > at org.apache.solr.search.QParser.getQuery(QParser.java:142) > > Cheers, > > -- stephane >