简体   繁体   English

当用户数量增加时,Lucene Indexing中的打开文件太多

[英]Too many open files in Lucene Indexing when number of users increase

I have been using Lucene Indexing and search technique for my web application. 我一直在为我的Web应用程序使用Lucene Indexing和搜索技术。 Initially I faced the "Too many Open files problem", after research I fixed it by using a common IndexSearcher for single user. 最初我遇到了“太多的打开文件问题”,经过研究我通过使用一个普通的IndexSearcher为单个用户修复它。 Then, when I tested the application with a greater number of concurrent users, it again started to bring "Too many Open files problem". 然后,当我使用更多并发用户测试应用程序时,它再次开始带来“太多打开文件问题”。

I am keeping the IndexSearcher Object in the session of particular user, which is always keeping a few files open(which they are currently using). 我将IndexSearcher对象保留在特定用户的会话中,这始终保持一些文件打开(他们当前正在使用)。 Could any one please help to overcome this issue even if there is any number of users? 即使有任何数量的用户,任何人都可以帮助解决这个问题吗?

Let me know if I am not clear anywhere in the above explanation. 如果我在上述说明中的任何地方都不清楚,请告诉我。

Lucene's FAQ has a nice entry about it . Lucene的FAQ有一个很好的条目

In a nutshell: 简而言之:

  • Check that all your Lucene IndexReader, IndexWriter, and IndexSearcher are correctly closed 检查所有Lucene IndexReader,IndexWriter和IndexSearcher是否已正确关闭
  • Try to use compound files, that limits the number of files created 尝试使用复合文件,这会限制创建的文件数
  • Increase the limit of opened file handles on your operating system 增加操作系统上打开的文件句柄的限制

I had similar problem with Lucene a while ago, and when you have a lot of concurrent users, this limit can easily be reached. 我刚才和Lucene有类似的问题,当你有很多并发用户时,很容易达到这个限制。 Increasing the file handles limit worked perfectly fine. 增加文件句柄限制工作完全正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM