BDB常用配置总结

本文详细介绍了如何在JE环境中查找配置属性,并通过使用setConfigParam方法进行参数设置。阐述了vstore缓存动态修改配置的过程,以及如何通过ChangeJEConfigServlet实现。解释了关键配置项如je.maxMemoryPercent、je.env.isTransactional等的作用和设置方式,同时讨论了日志文件、检查点、事务持久性、清理策略和内存管理等高级特性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

如果想查找JE的配置属性,建议在EnvironmentConfig类,EnvironmentMutableConfig类,EnvironmentParams类中查找解释。更多的参数设置可以用 setConfigParam 这个方法可设置选项非常多,举例envConfig.setConfigParam("je.log.fileMax","20000000");
设置日志文件最大为20M,默认是10M 。
vstore支持缓存动态修改JE配置的操作,是由com.taobao.vstore.app.web.servlet.admin.ChangeJEConfigServlet类完成,修改的属性配置必须是Mutable=yes,这个可通过EnvironmentConfig查看属性配置的Mutable值。
je.maxMemoryPercent=50 配置JE缓存,这个属性可以改变je能够使用的最大内存的占整个JVM虚拟机内存的百分比。
je.env.isTransactional=false 支持事务
je.nodeMaxEntries=256 每个节点的key数目
je.env.runCheckpointer=true 启动检查点
je.log.fileCacheSize=15000 缓存中保持打开文件句柄的数目
je.log.faultReadSize=4096 默认一次读多少
je.lock.nLockTables=16 并发数,等级于锁表数
je.cleaner.threads=4 cleaner的线程数
je.evictor.maxThreads=12 evictor的最大线程数
je.txn.durability=write_no_sync,write_no_sync,none 事务是否写同步
je.evictor.criticalPercentage=5 缓存内容达到maxMemoryPercent,又超过这个比例,将启动evictor清理内存。举例,假如是JVM设置了1G的内存,je.maxMemoryPercent=50,JE的缓存为500M,je.evictor.criticalPercentage=5,就是25M,500+25=525M,当缓存内容超过525M的时候,启动evictor剔除缓存中长时间不被访问的节点。
je.clean.je.cleaner.minFileUtilization=10,log文件最小利用率,低于此值启动cleaner清理无用日志文件
je.checkpointer.bytesInterval=10000000 缓存中脏数据大小阈值,超过这个阈值,写一次log
je.evictor.nodesPerScan=100 evictor一次扫描缓存的节点数
--------------------------一下是英文文章注释-----------------------------------------------
je.maxMemoryPercent=50
When using the shared cache feature, new environments that join the cache may alter the cache percent setting if their configuration is set to a different value.By default, JE sets its cache size proportionally to the JVM memory. This formula is used:je.maxMemoryPercent * JVM maximum memory。
where JVM maximum memory is specified by the JVM -Xmx flag. setCachePercent() specifies the percentage used and is equivalent to setting the je.maxMemoryPercent property in the je.properties file.
Calling setCacheSize() with a non-zero value overrides the percentage based calculation and sets the cache size explicitly.
Note that the log buffer cache may be cleared if the cache size is changed after the environment has been opened.
If setSharedCache(true) is called, setCacheSize and setCachePercent specify the total size of the shared cache, and changing these parameters will change the size of the shared cache.

je.env.isTransactional=false
the databases underlying this container are transactional.

je.nodeMaxEntries=256
Configure the maximum number of children a B+Tree node can have.

je.env.runCheckpointer=true
If true, starts up the checkpointer thread.

je.log.fileCacheSize=15000
The size of the file handle cache.

je.log.faultReadSize=4096
The buffer size for faulting in objects from disk, in bytes.

je.lock.nLockTables=16
Number of Lock Tables. Set this to a value other than 1 when an application has multiple threads performing concurrent JE operations.
It should be set to a prime number, and in general not higher than the number of application threads performing JE operations.

je.cleaner.threads=4
The number of threads allocated by the cleaner for log file processing.
If the cleaner backlog becomes large, try increasing this value.

je.evictor.maxThreads=12
The maximum number of threads in the eviction thread pool. These threads help keep memory usage within cache bound, offloading work from application threads. If the eviction thread pool receives more work, it will allocate up to this number of threads. These threads will terminate if they are idle for more than the time indicated by je.evictor.keepAlive.
je.evictor.coreThreads, je.evictor.maxThreads and je.evictor.keepAlive
are used to configure the core, max and keepalive attributes for the
ThreadPoolExecutor which implements the eviction thread pool.

je.txn.durability=write_no_sync,write_no_sync,none
Setting the je.txn.durability property in the je.properties file Equivalent to configures the durability associated with transactions. public EnvironmentMutableConfig setDurability(Durability durability).

je.evictor.criticalPercentage=5
At this percentage over the allotted cache, critical eviction will start.

je.checkpointer.bytesInterval=10000000
Ask the checkpointer to run every time we write this many bytes to the log.

je.evictor.nodesPerScan=100
The number of nodes in one evictor scan.When using the shared cache feature, the value of this property is applied the first time the cache is set up. New environments that join the cache do not alter the cache setting.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值