<org manual>翻译--3.5 电子表格
2013-05-18 12:47
330 查看
lucene在执行索引和检索时能同时打开多个文件,打开多个与共同使用一个有多大的区别?
在索引时能否对同一文件进行并发打开?
在检索时并发打开一个文件与公用一个打开句柄,哪个性能更好?
导致文件打开过多的可能用法:
Why am I getting an IOException that says "Too many open files"?
The number of files that can be opened simultaneously is a
system-wide limitation of your operating system. Lucene might cause
this problem as it can open quite some files depending on how you use
it, but the problem might also be somewhere else.
Always make sure that you explicitly
close all file
handles you open, especially in case of errors. Use a try/catch/finally
block to open the files, i.e. open them in the try block, close them in
the finally block. Remember that Java doesn't have destructors, so
don't close file handles in a finalize method -- this method is not
guaranteed to be executed.
Use the compound file format (it's activated by default starting with Lucene 1.4) by calling
IndexWriter's setUseCompoundFile(true)
Don't set
IndexWriter's mergeFactor
to large values. Large values speed up indexing but increase the number of files that need to be opened simultaneously.
If the exception occurs during searching, optimize your index calling
IndexWriter's optimize()
method after indexing is finished.
Make sure you only open one IndexSearcher, and share it among
all of the threads that are doing searches -- this is safe, and it will
minimize the number of files that are open concurently.
Try to increase the number of files that can be opened simultaneously. On Linux using bash this can be done by calling ulimit -n <number>
.
在索引时能否对同一文件进行并发打开?
在检索时并发打开一个文件与公用一个打开句柄,哪个性能更好?
导致文件打开过多的可能用法:
Why am I getting an IOException that says "Too many open files"?
The number of files that can be opened simultaneously is a
system-wide limitation of your operating system. Lucene might cause
this problem as it can open quite some files depending on how you use
it, but the problem might also be somewhere else.
Always make sure that you explicitly
close all file
handles you open, especially in case of errors. Use a try/catch/finally
block to open the files, i.e. open them in the try block, close them in
the finally block. Remember that Java doesn't have destructors, so
don't close file handles in a finalize method -- this method is not
guaranteed to be executed.
Use the compound file format (it's activated by default starting with Lucene 1.4) by calling
IndexWriter's setUseCompoundFile(true)
Don't set
IndexWriter's mergeFactor
to large values. Large values speed up indexing but increase the number of files that need to be opened simultaneously.
If the exception occurs during searching, optimize your index calling
IndexWriter's optimize()
method after indexing is finished.
Make sure you only open one IndexSearcher, and share it among
all of the threads that are doing searches -- this is safe, and it will
minimize the number of files that are open concurently.
Try to increase the number of files that can be opened simultaneously. On Linux using bash this can be done by calling ulimit -n <number>
.
相关文章推荐
- <org manual>翻译--3.5.8 更新表格
- &lt;org manual&gt;翻译--3.5 电子表格
- &lt;org manual&gt;翻译--3.1 内置的表格编辑器
- &lt;org manual&gt;翻译--3.5.8 更新表格
- &lt;org manual&gt;翻译--2.6 Sparse树
- &lt;org manual&gt;翻译--4.5 在Org-mode外使用链接
- &lt;org manual&gt;翻译--1.4 反馈 : BUG报告,好的想法,补丁等等
- &lt;org manual&gt;翻译--3.5.5 域公式和区间公式
- &lt;org manual&gt;翻译--2.5 结构编辑
- &lt;org manual&gt;翻译--4.4 链接的各种操作
- <org manual>翻译--3.1 内置的表格编辑器
- &lt;org manual&gt;翻译--激活
- &lt;org manual&gt;翻译--3.5.4 时长和时间的值
- &lt;org manual&gt;翻译--2.4 移动
- &lt;org manual&gt;翻译--4.3 外部链接
- &lt;org manual&gt;翻译--安装
- &lt;org manual&gt;翻译--3.5.3 Emacs Lisp写成的公式
- &lt;org manual&gt;翻译--2.3 可见性的转换
- &lt;org manual&gt;翻译--4.2 内部链接
- <org manual>翻译--3.5.1 引用