gpt4 book ai didi

java - Berkeley DB JE JDB文件不断增加

转载 作者:太空宇宙 更新时间:2023-11-04 09:59:09 27 4
gpt4 key购买 nike

我正在调试系统中的磁盘空间问题,发现 .jdb 文件占用了大部分空间。

浏览时,发现此链接https://backstage.forgerock.com/knowledge/kb/article/a14630082 ,就我而言,lnSizeCorrectionFactor 约为 1.4 并且 fileDeleted=false。我运行磁盘空间命令来查找空间利用率,结果发现所有 jdb 文件都非零,但大多数文件的利用率为 2-9 之间的个位数值。

我使用的是je-5.0.58版本,这不是最新的。我的问题是根据 BDB 文档 https://docs.oracle.com/cd/E17277_02/html/GettingStartedGuide/backgroundthreads.html#cleaner ,如果jdb文件达到小于默认值50%,则需要清理。就我而言,即使它们只有个位数,为什么它们没有得到清理?

我没有明确设置任何环境配置,因此根据定义它应该使用默认值。下面是创建 bdb 存储库的代码。

 private static Repository createBDBRepository(File environmentHome) throws 
RepositoryException {
BDBRepositoryBuilder builder = new BDBRepositoryBuilder();
builder.setName("localbdb");
builder.setEnvironmentHomeFile(environmentHome);
builder.setTransactionNoSync(false);

// Set BDB-JE flavor
builder.setProduct("JE");

builder.setCacheSize(20 * 1024 * 1024L);
return builder.build();
}

来自 je.info 文件的日志行

   Chose lowest utilized file for cleaning. fileChosen: 0x50cbecc totalUtilization: 49 bestFileUtilization: 8 lnSizeCorrectionFactor: 1.1012049 isProbe: false
No file selected for cleaning. totalUtilization: 50 bestFileUtilization: 8 lnSizeCorrectionFactor: 1.1012049 isProbe: false

最佳答案

正如 ForgeRock 文档所述,这是由于 BDB JE 版本 5 中的错误造成的,该错误已在版本 6 及更高版本中得到解决。

引用 BDB JE 6.x 发行说明:

An improvement was made to the calculation of log utilization to avoid under-cleaning or over-cleaning. For example, when log utilization was estimated to be lower than actual utilization, unnecessary over-cleaning would occur, which could reduce performance. Or when log utilization was estimated to be higher than actual utilization, under-cleaning would prevent reclaiming unused disk space. To prevent these problems, the size of each logged record is now stored in the Btree BINs (bottom internal nodes), so that utilization can be calculated correctly during record updates and deletions, while still avoiding a fetch of the old version of the record. With this change, the utilization adjustment facility in the log cleaner, which attempted to compensate for this problem by estimating utilization, is no longer needed by most applications.

Therefore the EnvironmentConfig.CLEANER_ADJUST_UTILIZATION parameter is now false by default rather than true, and will be disabled completely in a future version of JE. For more information, see the javadoc for this parameter.

[#22275] (6.0.7)

关于java - Berkeley DB JE JDB文件不断增加,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53721182/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com