lucene - Need to know pros and cons of using RAMDirectory -


I need to improve the performance of my Lucene search query. Can I use the Ramdirectory? Does it optimize performance? Is there any index size limit in this? I appreciate if anyone can list the professional and the opposition to use the RAM directory.

Thank you.

I compare the FS directory and the RAM directory.

  • Index size 1.4G
  • Centos, 5G memory

Search 1000 keywords, average / minimum / Maximum response time (MS) is here

  • FS directory
    • First run: 351/7/2611
    • Second run: 47/7/837
    • The third part (restart the app): 53/7/2343
  • RAM directory
    • First run: 38 /
    • Second run: 34/7/18 9
    • Third part (resume app): 38/7/9 5
    < / Li>

So, you can see that the RAM directory is faster than FS Dye Ectori, but after the OS file cache warm-up, the speed difference is not that much different. What is the disadvantage of RMDadiri? In my test

  • It eats more memory, 1.4G files need to be loaded in memory about 2G. While the FS directory uses only 700 meters, then it takes a long time for its full meaning.
  • More time is needed to load it, especially when the index file is large, when the index is opened, data needs to be copied into memory, it means that during the restart of the app more Request for time will be blocked.
  • It is not so practical to maintain two indexes at the same time. Since our app switches indices every few hours. We want the new index to get hot, while the old index is still working in the same tomcat.

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -