BDB常用配置總結

如果想查找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.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章