From 3b044315af30d97abd4f7ad4e249ba6a3de4639e Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Mon, 12 Dec 2011 11:57:14 +0000
Subject: [PATCH] Fix OPENDJ-383 : Expose JE fileCacheSize property through OpenDJ configuration and admin Added optional ds-cfg-db-log-filecache-size attribute.
---
opends/resource/schema/02-config.ldif | 6 ++++++
opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java | 10 +++++++++-
opends/src/admin/messages/LocalDBBackendCfgDefn.properties | 2 ++
opends/src/admin/defn/org/opends/server/admin/std/LocalDBBackendConfiguration.xml | 30 ++++++++++++++++++++++++++++++
opends/resource/config/config.ldif | 1 +
5 files changed, 48 insertions(+), 1 deletions(-)
diff --git a/opends/resource/config/config.ldif b/opends/resource/config/config.ldif
index 9909f4c..d64e429 100644
--- a/opends/resource/config/config.ldif
+++ b/opends/resource/config/config.ldif
@@ -199,6 +199,7 @@
ds-cfg-db-evictor-max-threads: 10
ds-cfg-db-evictor-keep-alive: 600 seconds
ds-cfg-db-log-file-max: 10 megabytes
+ds-cfg-db-log-filecache-size: 100
ds-cfg-db-logging-file-handler-on: true
ds-cfg-db-logging-level: CONFIG
ds-cfg-db-checkpointer-bytes-interval: 20 megabytes
diff --git a/opends/resource/schema/02-config.ldif b/opends/resource/schema/02-config.ldif
index c08368e..db6c1ac 100644
--- a/opends/resource/schema/02-config.ldif
+++ b/opends/resource/schema/02-config.ldif
@@ -2731,6 +2731,11 @@
SINGLE-VALUE
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
X-ORIGIN 'OpenDJ Directory Server' )
+attributeTypes: ( 1.3.6.1.4.1.36733.2.1.1.56
+ NAME 'ds-cfg-db-log-filecache-size'
+ SINGLE-VALUE
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+ X-ORIGIN 'OpenDJ Directory Server' )
objectClasses: ( 1.3.6.1.4.1.26027.1.2.1
NAME 'ds-cfg-access-control-handler'
SUP top
@@ -2796,6 +2801,7 @@
ds-cfg-db-evictor-keep-alive $
ds-cfg-db-evictor-nodes-per-scan $
ds-cfg-db-log-file-max $
+ ds-cfg-db-log-filecache-size $
ds-cfg-db-logging-file-handler-on $
ds-cfg-db-logging-level $
ds-cfg-db-checkpointer-bytes-interval $
diff --git a/opends/src/admin/defn/org/opends/server/admin/std/LocalDBBackendConfiguration.xml b/opends/src/admin/defn/org/opends/server/admin/std/LocalDBBackendConfiguration.xml
index a114369..4d61c59 100644
--- a/opends/src/admin/defn/org/opends/server/admin/std/LocalDBBackendConfiguration.xml
+++ b/opends/src/admin/defn/org/opends/server/admin/std/LocalDBBackendConfiguration.xml
@@ -663,6 +663,36 @@
</ldap:attribute>
</adm:profile>
</adm:property>
+ <adm:property name="db-log-filecache-size" advanced="true">
+ <adm:synopsis>
+ Specifies the size of the file handle cache.
+ </adm:synopsis>
+ <adm:description>
+ The file handle cache is used to keep as much opened log files
+ as possible. When the cache is smaller than the number of logs,
+ the database needs to close some handles and open log files it needs,
+ resulting in less optimal performances. Ideally, the size of the cache
+ should be higher than the number of files contained in the database.
+ Make sure the OS number of open files per process is also tuned
+ appropriately.
+ </adm:description>
+ <adm:requires-admin-action>
+ <adm:component-restart />
+ </adm:requires-admin-action>
+ <adm:default-behavior>
+ <adm:defined>
+ <adm:value>100</adm:value>
+ </adm:defined>
+ </adm:default-behavior>
+ <adm:syntax>
+ <adm:integer lower-limit="3" upper-limit="2147483647" />
+ </adm:syntax>
+ <adm:profile name="ldap">
+ <ldap:attribute>
+ <ldap:name>ds-cfg-db-log-filecache-size</ldap:name>
+ </ldap:attribute>
+ </adm:profile>
+ </adm:property>
<adm:property name="db-logging-file-handler-on" advanced="true">
<adm:synopsis>
Indicates whether the database should maintain a je.info file in
diff --git a/opends/src/admin/messages/LocalDBBackendCfgDefn.properties b/opends/src/admin/messages/LocalDBBackendCfgDefn.properties
index da4fae6..e52c202 100644
--- a/opends/src/admin/messages/LocalDBBackendCfgDefn.properties
+++ b/opends/src/admin/messages/LocalDBBackendCfgDefn.properties
@@ -35,6 +35,8 @@
property.db-evictor-max-threads.description=Specifies the maximum number of threads in the eviction thread pool. These threads help keep memory usage within cache bounds, offloading work from application threads. db-evictor-core-threads, db-evictor-max-threads and db-evictor-keep-alive are used to configure the core, max and keepalive attributes for the eviction thread pool.
property.db-evictor-nodes-per-scan.synopsis=Specifies the number of Btree nodes that should be evicted from the cache in a single pass if it is determined that it is necessary to free existing data in order to make room for new information.
property.db-evictor-nodes-per-scan.description=Changes to this property do not take effect until the backend is restarted. It is recommended that you also change this property when you set db-evictor-lru-only to false. This setting controls the number of Btree nodes that are considered, or sampled, each time a node is evicted. A setting of 10 often produces good results, but this may vary from application to application. The larger the nodes per scan, the more accurate the algorithm. However, don't set it too high. When considering larger numbers of nodes for each eviction, the evictor may delay the completion of a given database operation, which impacts the response time of the application thread. In JE 4.1 and later, setting this value too high in an application that is largely CPU bound can reduce the effectiveness of cache eviction. It's best to start with the default value, and increase it gradually to see if it is beneficial for your application.
+property.db-log-filecache-size.synopsis=Specifies the size of the file handle cache.
+property.db-log-filecache-size.description=The file handle cache is used to keep as much opened log files as possible. When the cache is smaller than the number of logs, the database needs to close some handles and open log files it needs, resulting in less optimal performances. Ideally, the size of the cache should be higher than the number of files contained in the database. Make sure the OS number of open files per process is also tuned appropriately.
property.db-log-file-max.synopsis=Specifies the maximum size for a database log file.
property.db-logging-file-handler-on.synopsis=Indicates whether the database should maintain a je.info file in the same directory as the database log directory.
property.db-logging-file-handler-on.description=This file contains information about the internal processing performed by the underlying database.
diff --git a/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java b/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java
index 8124590..6bef559 100644
--- a/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java
+++ b/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java
@@ -23,7 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
- * Portions Copyright 2010 ForgeRock AS.
+ * Portions Copyright 2010-2011 ForgeRock AS.
*/
package org.opends.server.backends.jeb;
@@ -202,6 +202,13 @@
public static final String ATTR_NUM_CLEANER_THREADS =
ConfigConstants.NAME_PREFIX_CFG + "db-num-cleaner-threads";
+ /**
+ * The name of the attribute which configures the size of the file
+ * handle cache.
+ */
+ public static final String ATTR_LOG_FILECACHE_SIZE =
+ ConfigConstants.NAME_PREFIX_CFG + "db-log-filecache-size";
+
/**
* The name of the attribute which may specify any native JE properties.
@@ -405,6 +412,7 @@
ATTR_CHECKPOINTER_WAKEUP_INTERVAL);
registerProp("je.lock.nLockTables", ATTR_NUM_LOCK_TABLES);
registerProp("je.cleaner.threads", ATTR_NUM_CLEANER_THREADS);
+ registerProp("je.log.fileCacheSize", ATTR_LOG_FILECACHE_SIZE);
}
catch (Exception e)
{
--
Gitblit v1.10.0