23.2 Introduction to Tuning Oracle Internet Directory

Note:

Oracle Internet Directory's out of box configuration is not optimal for most production or test deployments. You must follow at least the steps listed in Section 23.3, "Basic Tuning Considerations" to achieve optimal performance and availability.

for more information about Oracle Internet Directory configuration attributes.

23.3 Basic Tuning Considerations

Tuning is the adjustment of parameters to improve directory performance. The default Oracle Internet Directory configuration must be tuned in almost all deployments. Please review the requirements and recommendations in this section carefully.

23.3.1 Database Parameters

The suggested minimum values for Oracle Database instance parameters are described in Table 23-1:

Table 23-1 Minimum Values for Oracle Database Instance Parameters

Parameter

Value

Notes

sga_target and

sga_max_size

1700M for 32-bit systems

Applicable when SGA Auto Tuning using sga_target and sga_max_size is being used. Especially important for bulkdelete performance.

A higher value may be required if the directory size exceeds 1 million entries or a high rate of I/O is observed. In case of 64-bit systems, one can go up to 60-70% of the RAM available for the Oracle Database on the box.

db_cache_size

1200M for 32-bit systems.

Applicable when SGA Auto Tuning using sga_target and sga_max_size is not being used. (SGA auto tuning using sga_target and sga_max_size is recommended instead of this parameter.)

A higher value may be required if the directory size exceeds 1 million entries or a high rate of I/O is observed. In case of 64-bit systems, one can go up to 60-70% of the RAM available for the Oracle Database on the box.

shared_pool_size

300M

Applicable when SGA Auto Tuning using sga_target and sga_maxsize is not being used

session_cached_cursors

100

processes

500

pga_aggregate_target

300M

Before performing a large bulkload operation, set this to 1-4GB, if sufficient RAM is available. Set it back after the operation has completed

job_queue_processes

1 or more.

Tune this parameter only if you are using Oracle Database Advanced Replication-based multimaster replication

23.3.2 LDAP Server Attributes

Tune the number of processes and threads for the Oracle Internet Directory server instance that services LDAP application traffic. This has a major impact on overall performance. See the recommended settings for orclmaxcc and orclserverprocs in Table 23-2.

Disable change log generation if you are not deploying either replication or Oracle Directory Integration Platform. Set the attribute orclgeneratechangelog to 0.

Skip referrals in LDAP searches if you have no referral entries in the directory. Set orclskiprefinsql to 1. This can have a major impact on performance.

Close idle LDAP connections after a period of time instead of leaving them open. This prevents the unnecessary buildup of connections. For example, you can set orclldapconntimeout to 60 minutes.

As of 10g (10.1.4.0.1), you can only set this for users who are not configured for operation statistics tracking. Connections by users configured for statistics collection do not time out as per this setting.

Typically, you only need to do this when you add entries in bulk for the first time after installing Oracle Internet Directory. You do not need to do it again because the database statistics are updated nightly automatically. If, however, you suddenly experience slow LDAP operations, without a corresponding change in data footprint, consider running oidstats.sql once to see if that improves performance. The impact may be due to changes in database SQL execution plans, which oidstats.sql can help to improve.

You do not need to update database statistics if you use the bulkload tool to add the entries. The bulkload command automatically updates the database statistics.

23.4 Advanced Configurations

After you have performed the modifications recommended in the previous section, you can make additional changes that are specific to your deployment. Consider carefully whether the recommendations in this section are appropriate for your environment.

23.4.1 Replication or Oracle Directory Integration Platform

When you deploy Oracle Internet Directory with the Oracle Directory Integration Platform or with replication, you can improve performance by having a dedicated LDAP server instance for those two servers. This allows the default Oracle Internet Directory LDAP instance to serve the LDAP application traffic and the second instance to serve LDAP requests from the replication and Oracle Directory Integration Platform servers.

In an Oracle Internet Directory Cluster configuration (rack-mounted or multi-box), the replication server must be started on one hardware node only. The LDAP server instance dedicated to replication must be started on the same node. The Oracle Directory Integration Platform server can be on a different node.

23.4.2 Replication Server Configuration

The following recommendations can be useful when replication traffic is heavy. Be sure you understand the trade-offs before making these changes. The recommended values are summarized in Table 23-3.

If you are deploying a single master with read-only replica consumers, you may reduce performance impacts by turning off conflict resolution. To do so, change the value of orclconflresolution to 0.

If the supplier is a bottleneck, increase orclthreadspersupplier on the supplier. You can also increase orclthreadspersupplier at the consumer if is a bottleneck, but be aware that increased parallelism causes race conditions in the application of changelogs, resulting in more human intervention queue (HIQ) changes.

Decrease orclchangeretrycount so that new changelogs get more resources. If there are conflicts, however, this increases the human intervention queue (HIQ) changes.

Change orclupdateschedule to 0 to make the server process changelogs immediately, instead of at the default, 60-second intervals. Do this on both the supplier and consumer.

Increase the orclhiqschedule to a higher value. For example, if accessing the human intervention queue (HIQ) four times a day is sufficient and appropriate for your deployment, set the orclhiqschedule to 21600 seconds (6 hours).

23.4.3Garbage Collection Configuration

By default, Oracle Internet Directory runs database jobs to purge change logs, server manageability statistics, and other data beginning at midnight, with each job starting 15 minutes after the previous one. You can change this configuration to suite your deployment needs by modifying the parameters shown in Table 23-4.

23.4.4Oracle Internet Directory with Oracle RAC Database

As described in Section 23.4.2, "Replication Server Configuration", you can have a dedicated LDAP server for Oracle Directory Integration Platform and replication, in addition to the default server. In an Oracle Internet Directory Cluster, start the default LDAP instance on all Oracle Internet Directory nodes, but start the dedicated instance only on the node where Oracle Directory Integration Platform and replication are running.

You can configure the Oracle Internet Directory for load balancing between Oracle Database instances in the cluster, or failover mode.

If you use a dedicated LDAP server instance for replication and Oracle Directory Integration Platform, you can configure the connection strings of that instance for failover. You would use the following in tnsnames.ora:

(FAILOVER=ON)(LOAD_BALANCE=OFF)

When performing a bulk operation, such as bulkload, connect the tool to just one Oracle Database instance for the entire operation.

Configure Oracle Internet Directory instances as follows:

One Oracle Internet Directory instance on each of the nodes to service LDAP application traffic

An instance of the Oracle Internet Directory replication server and Oracle Directory Integration Platform server on one node

23.4.5Password Policies and Verifier Profiles

Oracle Internet Directory has password policies and password verifier profiles enabled out of box. If Oracle Internet Directory is not required to enforce password policies in a given deployment, then the password policies can be disabled. The password verifier profiles enabled out of box control the generation of certain password verifiers required by Oracle products like Enterprise User Security and Oracle Collaboration Suite. If Oracle Internet Directory is not being deployed for other Oracle products, you can disable all the password verifier profiles.

You can disable password policies and password verifiers by using Oracle Directory Services Manager or ldapmodify.

23.4.6 Server Entry Cache

The Oracle Internet Directory server entry cache enables LDAP entries to be cached on the Oracle Internet Directory server process heap for better performance. Configuring the entry cache provides benefits if, and only if, all or most entries can be cached.

Caution:

The server entry cache is beneficial for small directory deployments only. Some of the tuning recommendations here contradict the tuning recommendations in the earlier sections. Review the applicability of entry cache to a given deployment and incorporate the tuning mentioned in this section only if all considerations enumerated here are met.

23.4.6.1 When to Use the Entry Cache

Consider using Oracle Internet Directory Server Entry Cache only under the following conditions:

You are not using a cluster configuration

You expect a very low update rate, especially on group entries.

23.4.6.2 Benefits of Using the Entry Cache

One of the key benefits of using the entry cache is that the LDAP search operations with base scope are about five times as fast. This applies only when all or most entries can be cached. A cache miss is more expensive than disabling the entry cache.

23.4.6.3 Values for Configuring the Entry Cache

You can configure and optimize the server entry cache by setting the values shown in Table 23-5.

Table 23-5 Server Entry Cache Configuration

Attribute

Default

Recommended Value

Notes

orclmaxcc

2

10

Restart the server after changing this attribute.

orclserverprocs

1

Total number of cores on the system.

orclecacheenabled

1

1

orclecachemaxsize

200000000 Bytes

Total size of the directory, in bytes

To determine the optimal setting for this attribute, use the number of entries in the Directory Information Tree and multiply by the average entry size.

Estimate three times the size of the entries in LDIF format.

orclecachemaxentries

100000

Total number of entries in the DIT

orclecachemaxentsize

1000000

Size, in bytes, of the largest entry in the DIT

The largest entry is usually a group entry or an entry with binary attribute values.

For example, if the total size of the Directory Information Tree is 300K and the total size of 300K entries in LDAP Data Interchange Files (LDIF) format is 500M, you would set orclecacheenabled to 1, orclecachemaxsize to 1,500,000,000, and orclecachemaxentries to 300,000. If the size of the largest group entry or entry with binary value is 10M, you would set orclecachemaxentsize to 10,000,000.

To obtain the number of entries in the Directory Information Tree, use the following command:

23.4.7 Result Set Cache

Result set cache is an Oracle 11g OID feature that allows complete result sets to be stored in memory. If a SQL query is executed and its result set is in the cache then almost the entire overhead of the SQL execution is avoided: this includes parse time, logical reads, physical reads and any cache contention overhead (latches for instance) that might normally be incurred. Configuring the result cache can improve perfomance since most LDAP applications typically look up user entry such as mail=john.doe@acme.com or uid=john.doe from a user tree. Such queries are repeated by the application every time a user logins or uses the application. The result set of such queries may be a single entry. Performance may be affected as OID makes a trip to the database for the entry each time the query is run.

23.4.7.1 When to Use Result Set Cache

Consider using Result Set Cache only under the following conditions:

Filter matches one or few entries.

SQL statement causes multiple reads from disk or buffer (expensive)

23.4.7.2 Benefits of Using Result Set Cache

Benefits of using the entry cache include:

OID evaluates the filter without making a trip to the database and therefore reduces the load on the database.

Note that the result set cache database parameter can be configured on the client side or server side. When the server side cache is enabled, the result set cache can consume a significant amount of database memory and OID performance may be impacted.

Performance improved by 3 to 5 times when compared to performance when result set cache is not used.

23.4.7.3 Values for Configuring Result Set Cache

Note that any change to the following configuration attributes requires a restart of OID server (all the instances).

Table 23-6 Result Set Cache Attributes to Tune

Attribute

Default

Recommended Value

Notes

OrclRSCacheAttr

cn, mail, uid, orclguid

Multi valued attribute, Value contains the name of the Attribute. Typically these attributes are not modified for the life of the entry.

ResultSetMaxEntries

4

Maximum number of entries for a given search that can be cached.

ResultSetMaxCacheSize

10 MB

Maximum memory that can be allocated in the shared memory for the result set cache.

ResultSetMaxTime

8 hours

Time to live for the result set cache when the cache is full.

23.4.8 Tuning Security Event Tracking

The instance-specific configuration entry attributes orcloptrackmaxtotalsize and orcloptracknumelemcontainers control how much memory is used for security event tracking.

The attribute orcloptrackmaxtotalsize specifies the maximum number of bytes of RAM that security events tracking can use for each type of operation. If the Directory Server exceeds this limit for information collected for an operation, the server stops collecting new information and records appropriate messages in server log files. For the compare operation, the Directory Server uses twice the value of the attribute, which is the combined amount of information about users performing compare operation and users whose passwords are being compared. The default value of orcloptrackmaxtotalsize is 100000000 Bytes, which should be sufficient for most deployments. It can be increased to 200MB. For information about modifying orcloptrackmaxtotalsize, see the instance-specific configuration attribute examples in "Setting System Configuration Attributes by Using ldapmodify" in the Oracle Fusion Middleware Administrator's Guide for Oracle Internet Directory.

The attribute orcloptracknumelemcontainers allows you to choose the number of in-memory cache containers to be allocated for security event tracking in the Oracle Internet Directory server. There are two subtypes for this attribute. They are 1stlevel and 2ndlevel. The 1stlevel subtype is for setting the number of in-memory cache containers for storing information about users performing operations. The 2ndlevel subtype, which is applicable only to compare operation, sets the number of in-memory cache containers for information about the users whose user password is compared and tracked when detailed compare operation statistics is programmed.The default value of both subtypes is 256. The appropriate values for these subtypes depend on the number of users in your environment and the number of applications used to access the directory, as follows:

In a deployment where several applications perform operations on behalf of a large number of end users, set 1stlevel proportional to the number of applications, plus a few hundred more for end users directly accessing the directory. Then set 2ndlevel proportional to the number of end users.

In a deployment where end users themselves perform the operations, set 1stlevel proportional to the number of end users, then set 2ndlevel to a small value, such as 25.

A typical proportional value is one fifth. Proportions between one tenth and one half are reasonable in most environments.

If your deployment requires it, set the values for orcloptracknumelemcontainers only when security events collection is turned on.

23.5 Low-Priority Tuning Considerations

This section describes attributes that can sometimes improve performance, but are considered low-priority.

23.5.1 Number of Entries to be Returned by a Search

The attribute orclsizelimit controls the maximum number of entries to be returned by a search. The default value is 10000. Setting it very high impacts server performance. It also plays a role in limiting the maximum number of changelogs the replication server can process at a time.

23.5.2 Enabling the Group Cache

The instance-specific subentry attribute orclenablegroupcache controls whether privilege groups and ACL groups are cached. Using this cache can improve the performance of access control evaluation for users.

Use the group cache when a privilege group membership does not change frequently. If a privilege group membership does change frequently, then it is best to turn off the group cache. It is important to note that computing a group cache may affect performance. The default is 1 (enabled). Change to 0 (zero) to disable.

23.5.3 Timeout for Write Operations

When an LDAP client initiates an operation, then does not respond to the server for a configured number of seconds, the server closes the connection. The number of seconds is controlled by the orclnwrwtimeout attribute of the instance-specific configuration entry. The default is 30 seconds.

23.6 Specific Use Cases

23.6.1 Bulk Load Operation

If you are planning a large bulkload operation, make the following changes:

Set the database initialization parameter pga_aggregate_target to 1-4GB for the duration of the operation, if sufficient RAM is available.

Increase the database temporary tablespace before loading a large number entries. You need about 1G of temporary tablespace per million entries being loaded. You can free up the tablespace after the operation.

23.6.2 Bulk Delete Operation

If you are planning a large bulkdelete operation, perform the following tasks:

23.7.1 Optimizing Searches for Large Group Entries

Searches for group entries with several thousand attribute values for either the member or uniquemember attribute can have high latency. If you find the latency unacceptably high, there are steps you can take to reduce it.

The simplest step is to reduce the number of attributes you are searching for. If you do not need to retrieve all the attributes of the group entry, specify required attributes in the search request to optimize the latency.

23.7.1.1 Entry Cache Enabled Configuration

If you still see unacceptable latency, even with required attributes specified, then you can try to cache the large group entry in the entry cache. To do this, increase the value of the orclEcacheMaxEntSize attribute in the instance-specific configuration entry:

cn=componentname,cn=osdldapd,cn=subconfigsubentry

This attribute controls the maximum size of a cache entry.

Note:

If you expect frequent updates to large groups, then do not use this tuning methodology. Use the Entry Cache Disabled Configuration.

23.7.1.2 Entry Cache Disabled Configuration.

No action is required. This configuration is enabled by default.

23.7.2 Optimizing Searches for Skewed Attributes

To service a typical search request, the Directory Server sends a SQL statement to the Oracle Database. If a given attribute has very different response times depending on its value, then the attribute is said to be skewed. For example, if searches for my_attribute=value1 and my_attribute=value2 have very different response times, then my_attribute is said to be a skewed.

You can uniform the response times for searches for such an attribute by adding it as a value of the orclskewedattribute attribute, which is in the DSA configuration entry. The DN of the DSA configuration entry is

cn=dsaconfig,cn=configsets,cn=oracle internet directory

By default, the objectclass attribute is listed as a value in the orclskewedattribute attribute.

23.7.3 Optimizing Performance of Complex Search Filters

When Oracle Internet Directory receives an LDAP search filter from a client application, it sends the filter to the Oracle Database as an SQL query. Sometimes client applications send filters that include terms that match a large number of entries in the directory. For example, consider the following filter:

(&(uid=msmith)(objectclass=inetorgperson)(orclisenabled=TRUE))

The terms (objectclass=inetorgperson) and (orclisenabled=TRUE) in that filter match nearly all entries. It would be very resource-intensive to execute that entire filter in the Oracle Database. To improve performance, you can specify that Oracle Internet Directory execute a portion of that filter in its own memory, rather than in the database. To do that, you use orclinmemfiltprocess, an attribute in the DSA configuration entry:

cn=dsaconfig,cn=configsets,cn=oracle internet directory

When orclinmemfiltprocess is configured, the following events occur each time Oracle Internet Directory receives an LDAP search:

Oracle Internet Directory removes all the terms that are configured in the orclinmemfiltprocess before forming the SQL query.

Oracle Internet Directory applies the original filter sent by the client (the terms in orclinmemfiltprocess) to those entries in memory.

Oracle Internet Directory sends the entries that match that filter to the client.

For example, suppose orclinmemfiltprocess is set to (objectclass=inetorgperson)(orclisenabled=TRUE). When Oracle Internet Directory receives the search (&(uid=msmith)(objectclass=inetorgperson)(orclisenabled=TRUE)), it sends a filter containing only the parameter (uid=msmith) to the database. After Oracle Internet Directory receives entries back from the database, Oracle Internet Directory itself applies the filter (objectclass=inetorgperson) (orclisenabled=TRUE) to those entries.

Oracle Internet Directory sends only (&(uid=rmsmith)) to the database, then applies the filter (&(objectclass=inetorgperson)(employeetype=Contract)) to the entries that are returned from the database.

Case C

(|(uid=rmsmith)(objectclass=inetorgperson) (employeetype=Contract))

In this filter, the terms that match orclinmemfiltprocess are part of an OR condition. Oracle Internet Directory sends the filter, as is, to the database.

Case D

(&(uid=rmsmith)(employeetype=Contract) (objectclass=inetorgperson))

Even though some of the terms in this filter match orclinmemfiltprocess, they are in a different order, so Oracle Internet Directory sends the whole filter to the database. You could add (employeetype=Contract)(objectclass=inetorgperson) to orclinmemfiltprocess if you do not want Oracle Internet Directory to send this filter to the database.

Even though this filter contains an OR operator, it is not applied to the terms that match orclinmemfiltprocess. Oracle Internet Directory sends (&(|(uid=rmsmith)(sn=smith))) to the directory and applies the filter (&(manager=cn=john doe)(&(objectclass=inetorgperson) (employeetype=Contract)) to the entries that are returned from the database.

Configuring Multiple Filters

If the application is sending multiple filters, and the terms in one filter are a superset of the terms in the other, you must configure orclinmemfiltprocess for both values.For example, suppose the application is sending the following two filters:

where (departmentNumber=627) matches a lot of entries. You must configure orclinmemfiltprocess as follows:

(objectclass=inetorgperson)(employeetype=Contract)

(departmentNumber=627)

Optimizing Performance for Search baseDN

In the DIT, if all the users are under one baseDN, such as cn=users,dc=acme,dc=com, and all the LDAP search clients send base as cn=users,dc=acme,dc=com, then the configuration of the orclinmemfilter will significantly reduce database processing time. See the following example:

orclinmemfiltprocess;dn: cn=users,dc=acme,dc=com

23.8 Evaluating Performance on UNIX and Windows Systems

Knowledge of the following tools is recommended for Linux, Solaris, and other UNIX-like operating systems:

Tool

Description

top

Displays the top CPU consumers on a system

vmstat

Shows running statistics on various parts of the system including the Virtual Memory Manager

mpstat

Shows an output similar to vmstat but split across various CPUs in the system. This is available on Solaris only.

iostat

Shows the disk I/O statistics from various disk controllers

sar

Collect, report, or save system activity information.

Knowledge of the following tools is recommended for Microsoft Windows:

Tool

Description

Windows Performance Monitor

Provides a customized view of the events in the system

Windows Task Manager

Provides a high level output (like top on UNIX) of the major things happening in the system.

Knowledge of the following tools is recommended for the Oracle Database:

On each page, specify values for the text fields (or use defaults) and Select Yes or No for each question. Some choices might be greyed out, depending upon your previous choices. Most fields have tool tips that appear when you move the cursor over the field.

Click Next to go to the next page or Back to return to the previous page. Click Cancel to close the wizard.

On the Review page, review the data you entered. Click Back to change your specifications or click Finish to view the report.

The report appears on the bottom right section of the page.

To download the report, click Download Report. To delete the report, click Delete.

Sizing

From the Oracle Internet Directory menu, change the report name, then select Administration, then Tuning and Sizing.

Click the Create icon to invoke the wizard.

On the Type Selection page, select Sizing.

Select Basic or Advanced.

On the Sizing page, specify values for the text fields (or use defaults) and Select Yes or No for each question. Some choices might be greyed out, depending upon your previous choices.

Click Next.

On the Review page, review the data you entered. Click Back to change your specifications or click Finish to view the report.

The report appears on the bottom right section of the page.

To download the report, click Download Report. To delete the report, click Delete.

Both

From the Oracle Internet Directory menu, change the report name, then select Administration, then Tuning and Sizing.

On each page, specify values for the text fields (or use defaults) and Select Yes or No for each question. Some choices might be greyed out, depending upon your previous choices.

Click Next to go to the next page or Back to return to the previous page. Click Cancel to close the wizard.

On the Review page, review the data you entered. Click Back to change your specifications or click Finish to view the report.

The report appears on the bottom right section of the page.

To download the report, click Download Report. To delete the report, click Delete.

23.10 Updating Database Statistics by Using oidstats.sql

Database statistics are updated automatically, OIDMON runs oidstats.sql for every configured number of updates to the database. By default, for every 5000 entries added OIDMON runs the oidstats.sql. This frequency can be changed using ldapmodify commad as shown below

23.12 Managing System Configuration Attributes

You can set most performance-related system configuration attributes from Oracle Enterprise Manager Fusion Middleware Control or from the command line. You can also use the Data Browser in Oracle Directory Services Manager to modify system configuration attributes.

You can modify orclpurgetargetage and orclpurgeinterval by using the data browser in Oracle Directory Services Manager. You cannot navigate to the changelog purging configuration entry directly in the data tree, but you can get to it by using an advanced search as follows:

On the Data Browser tab, click Advanced.

Expand Garbage Collection in the left pane, then select changelog purgeconfig. The Garbage Collector Window appears in the right pane.

In the right pane, enter the changes you want to make to the Purge Target Age and Purge Interval.

Choose Apply.

Scripting on this page enhances content navigation, but does not change the content in any way.