【发布时间】:2012-10-09 10:42:35
【问题描述】:
在我的应用程序中,我使用 Hibernate Search 来管理我的一些映射模型类(10 个类,部分相互关联 - 使用 @987654322)的 Lucene 索引@ 在索引定义中有相当长的时间)。大约有。 1,500,000 个要索引的文档
为了重建整个索引,我使用文档中建议的质量索引器 http://docs.jboss.org/hibernate/search/3.3/reference/en-US/html/manual-index-changes.html
fullTextSession
.createIndexer()
.batchSizeToLoadObjects(200)
.cacheMode(CacheMode.IGNORE)
.purgeAllOnStart(true)
.threadsToLoadObjects(10)
.threadsForIndexWriter(10)
.threadsForSubsequentFetching(5)
.startAndWait();
我的数据库连接池大小为 50
我观察到索引过程开始很有希望,直到它达到所有文档的 25% 左右。之后性能急剧下降(接下来的 5% 所花费的时间是前 25% 的两倍),我想知道为什么会发生这种情况?
- 我的对象加载线程和索引线程的比例是否错误?
- 或者仅仅是因为索引的大小不断增长?这是否证明了这种性能下降是合理的?
- 如何提高性能?如何实现时间的不断进步?
因为我使用投影而不是让 Hibernate Search 从 DB 中获取搜索结果,所以我的许多索引字段都存储在 Index (Store.YES) 中。这会显着影响性能吗?
-- 编辑:
我的 Hibernate 搜索配置:
properties.setProperty("hibernate.search.default.directory_provider", "filesystem");
properties.setProperty("hibernate.search.default.indexBase", searchIndexPath);
properties.setProperty("hibernate.search.indexing_strategy", "manual");
properties.setProperty("hibernate.default_batch_fetch_size", "200");
【问题讨论】:
标签: performance lucene hibernate-search