lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lutan <>
Subject The performance of lucene searching(web entironment) test
Date Tue, 10 Jun 2008 13:11:12 GMT

I have recently done some tests on lucene. I do not know whether the test results normal.
hd entironment:Intel(R) Xeon(R) CPU   5110  @ 1.60GHz4GB ram sw entironment:centOS4.6+sun
jdk 1.5+jboss+lucene2.3.2+je-analysis(a chinese analysis)there are 10 million+ documents which
total about 3GB test steps: 1 run single searcher.jsp in jboss(tuning ,and use 1GB ram)2 use
loadrunner  to test   simulation  10 user concurrent  request.    the TPS(transactions per
second) about 10   simulation  50 user concurrent  request.    the TPS(transactions per second)
about 8   simulation  100 user concurrent  request.    the TPS(transactions per second) about
2 and the jsp was very simple,index in local file system-------------------------------------------------------------------------------------------------
 <body>    <center>   <form action="lucene.jsp" method="post" name="form1"
>    <input type="text" value="" name="keyword2"/>    <input type="submit" value="searcher"
  <input type="reset" value="exit"/>   </form>   </center>     <hr>
 <%   if(request.getParameter("keyword2")!=null && !"".equals(request.getParameter("keyword2")))
{    String dir="/usr/local/index";  String key="name";  String word = new String(request.getParameter("keyword2"),"utf-8")
;  Searcher searcher = null;  searcher = new IndexSearcher(FSDirectory.getDirectory(dir, false));
 Analyzer myAnalyzer=new jeasy.analysis.MMAnalyzer();  QueryParser queryParser=new QueryParser(key,myAnalyzer);
 Query query=queryParser.parse(word);           Hits hits = null;  long startTime = System.nanoTime();
       hits=;          long estimatedTime = System.nanoTime() - startTime;
        BigDecimal bb = new BigDecimal(estimatedTime);        BigDecimal ee = new BigDecimal(1000000000);
       System.out.println("Key word: "+word+" Hits:" + hits.length()+"  Cost time: "+ bb.divide(ee)
+ "/s");    searcher.close();    }  out.print("ABC") ; %>  </body>   ---------------
and I also try to use Singleton IndexSearcher ,but it's seam not helpful.--------------------------------------------------------------------------------
public IndexSearcher getIndexSearcher() throws IOException {  if (this.indexSearcher == null)
{   return new IndexSearcher(FSDirectory.getDirectory(folder, false));  } else {   IndexReader
ir = indexSearcher.getIndexReader();   if (!ir.isCurrent()) {    this.indexSearcher.close();
   this.indexSearcher = new IndexSearcher(FSDirectory.getDirectory(folder, false));    ir
= indexSearcher.getIndexReader();    if (ir.hasDeletions()) {     if (this.indexWriter !=
null) {      this.indexWriter.optimize();     }    }   }   return this.indexSearcher;  } }
--------------------------------------------- use the same code in application search one
times per 0.5s how do I i
 mprove the seaching  performance in  concurrent entironment ? Does the hd entironment: Intel(R)
Xeon(R) CPU   5110  @ 1.60GHz4GB ramgive  me     50+TPS?
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message