From 9af43eca4430187d14dc3b23f8e731720259a935 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Fri, 26 Nov 2010 17:56:13 +0000
Subject: [PATCH] Resolves issue OPENDJ-11 - Update the Berkeley DB Java Edition 4.1.6. Introduce 3 new parameters to tune the new DB-Cache evictor functionality
---
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationKey.java | 3 +
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationData.java | 3 +
opendj-sdk/opends/src/admin/messages/LocalDBBackendCfgDefn.properties | 6 ++
opendj-sdk/opends/resource/config/config.ldif | 4 +
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationDraftCNKey.java | 3 +
opendj-sdk/opends/lib/je.jar | 0
opendj-sdk/opends/resource/schema/02-config.ldif | 24 +++++++-
opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/LocalDBBackendConfiguration.xml | 77 +++++++++++++++++++++++++
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java | 23 +++++++
opendj-sdk/opends/src/server/org/opends/server/replication/server/DraftCNData.java | 3 +
10 files changed, 143 insertions(+), 3 deletions(-)
diff --git a/opendj-sdk/opends/lib/je.jar b/opendj-sdk/opends/lib/je.jar
index a821080..866543a 100644
--- a/opendj-sdk/opends/lib/je.jar
+++ b/opendj-sdk/opends/lib/je.jar
Binary files differ
diff --git a/opendj-sdk/opends/resource/config/config.ldif b/opendj-sdk/opends/resource/config/config.ldif
index f076d15..829da26 100644
--- a/opendj-sdk/opends/resource/config/config.ldif
+++ b/opendj-sdk/opends/resource/config/config.ldif
@@ -21,6 +21,7 @@
# CDDL HEADER END
#
# Copyright 2006-2010 Sun Microsystems, Inc.
+# Portions Copyright 2010 ForgeRock AS.
#
#
# This file contains the primary Directory Server configuration. It must not
@@ -195,6 +196,9 @@
ds-cfg-db-cleaner-min-utilization: 50
ds-cfg-db-evictor-lru-only: true
ds-cfg-db-evictor-nodes-per-scan: 10
+ds-cfg-db-evictor-core-threads: 1
+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-logging-file-handler-on: true
ds-cfg-db-logging-level: CONFIG
diff --git a/opendj-sdk/opends/resource/schema/02-config.ldif b/opendj-sdk/opends/resource/schema/02-config.ldif
index 0923bcf..51680d4 100644
--- a/opendj-sdk/opends/resource/schema/02-config.ldif
+++ b/opendj-sdk/opends/resource/schema/02-config.ldif
@@ -22,7 +22,7 @@
#
#
# Copyright 2006-2010 Sun Microsystems, Inc.
-# Portions Copyright 2010 ForgeRock AS
+# Portions Copyright 2010 ForgeRock AS.
#
#
# This file contains the attribute type and objectclass definitions for use
@@ -2534,11 +2534,26 @@
NAME 'ds-cfg-max-ops-interval'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
X-ORIGIN 'OpenDS Directory Server' )
-attributeTypes: ( 1.3.6.1.4.1.26027.999.1
+attributeTypes: ( 1.3.6.1.4.1.36733.2.1.1.1
NAME 'ds-cfg-crypt-password-storage-encryption-algorithm'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE
- X-ORIGIN 'OpenDS Directory Server' )
+ X-ORIGIN 'OpenDJ Directory Server' )
+attributeTypes: ( 1.3.6.1.4.1.36733.2.1.1.2
+ NAME 'ds-cfg-db-evictor-core-threads'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+ SINGLE-VALUE
+ X-ORIGIN 'OpenDJ Directory Server' )
+attributeTypes: ( 1.3.6.1.4.1.36733.2.1.1.3
+ NAME 'ds-cfg-db-evictor-max-threads'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+ SINGLE-VALUE
+ X-ORIGIN 'OpenDJ Directory Server' )
+attributeTypes: ( 1.3.6.1.4.1.36733.2.1.1.4
+ NAME 'ds-cfg-db-evictor-keep-alive'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+ SINGLE-VALUE
+ X-ORIGIN 'OpenDJ Directory Server' )
objectClasses: ( 1.3.6.1.4.1.26027.1.2.1
NAME 'ds-cfg-access-control-handler'
SUP top
@@ -2599,6 +2614,9 @@
ds-cfg-db-run-cleaner $
ds-cfg-db-cleaner-min-utilization $
ds-cfg-db-evictor-lru-only $
+ ds-cfg-db-evictor-core-threads $
+ ds-cfg-db-evictor-max-threads $
+ ds-cfg-db-evictor-keep-alive $
ds-cfg-db-evictor-nodes-per-scan $
ds-cfg-db-log-file-max $
ds-cfg-db-logging-file-handler-on $
diff --git a/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/LocalDBBackendConfiguration.xml b/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/LocalDBBackendConfiguration.xml
index 2b529c2..fcf5bd4 100644
--- a/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/LocalDBBackendConfiguration.xml
+++ b/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/LocalDBBackendConfiguration.xml
@@ -24,6 +24,7 @@
!
!
! Copyright 2007-2010 Sun Microsystems, Inc.
+ ! Portions Copyright 2010 ForgeRock AS.
! -->
<adm:managed-object name="local-db-backend"
plural-name="local-db-backends" package="org.opends.server.admin.std"
@@ -561,6 +562,82 @@
</ldap:attribute>
</adm:profile>
</adm:property>
+ <adm:property name="db-evictor-core-threads" advanced="true">
+ <adm:synopsis>
+ Specifies the core number of threads in the eviction thread pool.
+ </adm:synopsis>
+ <adm:description>
+ Specifies the core 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.
+ </adm:description>
+ <adm:default-behavior>
+ <adm:defined>
+ <adm:value>1</adm:value>
+ </adm:defined>
+ </adm:default-behavior>
+ <adm:syntax>
+ <adm:integer lower-limit="0" upper-limit="2147483647" />
+ </adm:syntax>
+ <adm:profile name="ldap">
+ <ldap:attribute>
+ <ldap:name>ds-cfg-db-evictor-core-threads</ldap:name>
+ </ldap:attribute>
+ </adm:profile>
+ </adm:property>
+ <adm:property name="db-evictor-max-threads" advanced="true">
+ <adm:synopsis>
+ Specifies the maximum number of threads in the eviction thread pool.
+ </adm:synopsis>
+ <adm: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.
+ </adm:description>
+ <adm:default-behavior>
+ <adm:defined>
+ <adm:value>10</adm:value>
+ </adm:defined>
+ </adm:default-behavior>
+ <adm:syntax>
+ <adm:integer lower-limit="1" upper-limit="2147483647" />
+ </adm:syntax>
+ <adm:profile name="ldap">
+ <ldap:attribute>
+ <ldap:name>ds-cfg-db-evictor-max-threads</ldap:name>
+ </ldap:attribute>
+ </adm:profile>
+ </adm:property>
+ <adm:property name="db-evictor-keep-alive" advanced="true">
+ <adm:synopsis>
+ The duration that excess threads in the eviction thread pool will
+ stay idle. After this period, idle threads will terminate.
+ </adm:synopsis>
+ <adm:description>
+ The duration that excess threads in the eviction thread pool will
+ stay idle. After this period, idle threads will terminate.
+ 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.
+ </adm:description>
+ <adm:default-behavior>
+ <adm:defined>
+ <adm:value>600s</adm:value>
+ </adm:defined>
+ </adm:default-behavior>
+ <adm:syntax>
+ <adm:duration base-unit="s" lower-limit="1" upper-limit="86400" />
+ </adm:syntax>
+ <adm:profile name="ldap">
+ <ldap:attribute>
+ <ldap:name>ds-cfg-db-evictor-keep-alive</ldap:name>
+ </ldap:attribute>
+ </adm:profile>
+ </adm:property>
<adm:property name="db-log-file-max" advanced="true">
<adm:synopsis>
Specifies the maximum size for a database log file.
diff --git a/opendj-sdk/opends/src/admin/messages/LocalDBBackendCfgDefn.properties b/opendj-sdk/opends/src/admin/messages/LocalDBBackendCfgDefn.properties
index 69711d9..82052a9 100644
--- a/opendj-sdk/opends/src/admin/messages/LocalDBBackendCfgDefn.properties
+++ b/opendj-sdk/opends/src/admin/messages/LocalDBBackendCfgDefn.properties
@@ -25,8 +25,14 @@
property.db-directory-permissions.synopsis=Specifies the permissions that should be applied to the directory containing the server database files.
property.db-directory-permissions.description=They should be expressed as three-digit octal values, which is the traditional representation for UNIX file permissions. The three digits represent the permissions that are available for the directory's owner, group members, and other users (in that order), and each digit is the octal representation of the read, write, and execute bits. Note that this only impacts permissions on the database directory and not on the files written into that directory. On UNIX systems, the user's umask controls permissions given to the database files.
property.db-directory-permissions.syntax.string.pattern.synopsis=Any octal value between 700 and 777 (the owner must always have read, write, and execute permissions on the directory).
+property.db-evictor-core-threads.synopsis=Specifies the core number of threads in the eviction thread pool.
+property.db-evictor-core-threads.description=Specifies the core 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-keep-alive.synopsis=The duration that excess threads in the eviction thread pool will stay idle. After this period, idle threads will terminate.
+property.db-evictor-keep-alive.description=The duration that excess threads in the eviction thread pool will stay idle. After this period, idle threads will terminate. 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-lru-only.synopsis=Indicates whether the database should evict existing data from the cache based on an LRU policy (where the least recently used information will be evicted first).
property.db-evictor-lru-only.description=If set to "false", then the eviction keeps internal nodes of the underlying Btree in the cache over leaf nodes, even if the leaf nodes have been accessed more recently. This may be a better configuration for databases in which only a very small portion of the data is cached.
+property.db-evictor-max-threads.synopsis=Specifies the maximum number of threads in the eviction thread pool.
+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 100 often produces good results, but this may vary from application to application. The larger the nodes per scan, the more accurate the algorithm. However, setting it too high is detrimental; the need to consider larger numbers of nodes for each eviction may delay the completion of a given database operation, which will impact the response time of the application thread.
property.db-log-file-max.synopsis=Specifies the maximum size for a database log file.
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java
index 5de7a6a..8124590 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ConfigurableEnvironment.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
+ * Portions Copyright 2010 ForgeRock AS.
*/
package org.opends.server.backends.jeb;
@@ -135,6 +136,25 @@
public static final String ATTR_EVICTOR_NODES_PER_SCAN =
ConfigConstants.NAME_PREFIX_CFG + "db-evictor-nodes-per-scan";
+ /**
+ * The name of the attribute which configures the minimum number of threads
+ * of the database cache evictor pool.
+ */
+ public static final String ATTR_EVICTOR_CORE_THREADS =
+ ConfigConstants.NAME_PREFIX_CFG + "db-evictor-core-threads";
+ /**
+ * The name of the attribute which configures the maximum number of threads
+ * of the database cache evictor pool.
+ */
+ public static final String ATTR_EVICTOR_MAX_THREADS =
+ ConfigConstants.NAME_PREFIX_CFG + "db-evictor-max-threads";
+
+ /**
+ * The name of the attribute which configures the time excess threads
+ * of the database cache evictor pool are kept alive.
+ */
+ public static final String ATTR_EVICTOR_KEEP_ALIVE =
+ ConfigConstants.NAME_PREFIX_CFG + "db-evictor-keep-alive";
/**
* The name of the attribute which configures whether the logging file
@@ -375,6 +395,9 @@
registerProp("je.env.runCleaner", ATTR_DATABASE_RUN_CLEANER);
registerProp("je.evictor.lruOnly", ATTR_EVICTOR_LRU_ONLY);
registerProp("je.evictor.nodesPerScan", ATTR_EVICTOR_NODES_PER_SCAN);
+ registerProp("je.evictor.coreThreads", ATTR_EVICTOR_CORE_THREADS);
+ registerProp("je.evictor.maxThreads", ATTR_EVICTOR_MAX_THREADS);
+ registerProp("je.evictor.keepAlive", ATTR_EVICTOR_KEEP_ALIVE);
registerProp("je.log.fileMax", ATTR_DATABASE_LOG_FILE_MAX);
registerProp("je.checkpointer.bytesInterval",
ATTR_CHECKPOINTER_BYTES_INTERVAL);
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/DraftCNData.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/DraftCNData.java
index 5831952..fc4c171 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/DraftCNData.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/DraftCNData.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
+ * Portions Copyright 2010 ForgeRock AS.
*/
package org.opends.server.replication.server;
@@ -40,6 +41,8 @@
{
private static final String FIELD_SEPARATOR = "!";
+ private static final long serialVersionUID = 1L;
+
String value;
String serviceID;
ChangeNumber changeNumber;
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationData.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationData.java
index 4ac650b..52022f9 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationData.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationData.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2006-2009 Sun Microsystems, Inc.
+ * Portions Copyright 2010 ForgeRock AS.
*/
package org.opends.server.replication.server;
@@ -40,6 +41,8 @@
*/
public class ReplicationData extends DatabaseEntry
{
+ private static final long serialVersionUID = 1L;
+
/**
* Creates a new ReplicationData object from an UpdateMsg.
*
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationDraftCNKey.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationDraftCNKey.java
index e4862d2..a210893 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationDraftCNKey.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationDraftCNKey.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
+ * Portions Copyright 2010 ForgeRock AS.
*/
package org.opends.server.replication.server;
@@ -36,6 +37,8 @@
*/
public class ReplicationDraftCNKey extends DatabaseEntry
{
+ private static final long serialVersionUID = 1L;
+
/**
* Creates a new ReplicationKey from the given draft ChangeNumber.
* @param draftCN The draft change number to use.
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationKey.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationKey.java
index badc240..2fdbdcb 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationKey.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationKey.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
+ * Portions Copyright 2010 ForgeRock AS.
*/
package org.opends.server.replication.server;
@@ -38,6 +39,8 @@
*/
public class ReplicationKey extends DatabaseEntry
{
+ private static final long serialVersionUID = 1L;
+
/**
* Creates a new ReplicationKey from the given ChangeNumber.
* @param changeNumber The changeNumber to use.
--
Gitblit v1.10.0