lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lutan <ws...@live.cn>
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"
onclick="SUB()"/>   
  <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= searcher.search(query);          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>   ---------------
 ----------------------search.jsp---------------------------------------------------------
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;  } }------------------------------------GetsingletonIndexsearcher.java
--------------------------------------------- use the same code in application search one
times per 0.5s average.so 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?
_________________________________________________________________
用手机MSN聊天写邮件看空间,无限沟通,分享精彩!
http://mobile.msn.com.cn/
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message