Thank you for the tip Emmanuel.
But its not seem to help me.
Actually,
I have a custom schema and partition created in ADS and the 40K entries I
mentioned follows the custom objectClass definition.(below)
objectClass ( 1.3.6.1.4.1.17370.2.2.1
NAME 'mbxperson'
SUP top STRUCTURAL
MUST ( uid $ cn $ gn $ sn $ telephoneNumber )
MAY ( mobileNumber $ ou $ primaryExtention $ title )
X-ORIGIN 'user defined' )
I have attached the server.xml also for your reference.
My searches are based on names,primaryExtention and telephoneNumber. The
performance looks the same as when no indexes specified.
I have even wiped the whole data off and recreated the entries again to make
sure the indexes applied correctly.
Am I missing anything in the loop in this process? Is there any step I missed
out completely??
It would be great if you could help?
Thanks in advance.
Regards,
Siva.
-----Original Message-----
From: Emmanuel Lecharny [mailto:[EMAIL PROTECTED]
Sent: 24 January 2008 16:06
To: Apache Directory Developers List
Subject: Re: Searching takes unrealistic time.
Siva Kumar wrote:
> <bean
> class="org.apache.directory.server.core.partition.impl.btree.MutableIn
> de
> xConfiguration">
> <property name="attributeId" value="uid" />
> <property name="cacheSize" value="100" />
>
Considering you are using the uid attribute, with 40 000 entries in your base,
the current cacheSize will hold 0,25% of the existing uid. That means you are
roughly doing a disk access each time you search for an entry.
Increase the cacheSize for each attribute your filters are using. Here, 40 000
will be ok.
Be aware that you may have to increase the JVM memory size to avoid OOM
exception too...
Hope it helps
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="environment" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="java.naming.security.authentication">simple</prop>
<prop key="java.naming.security.principal">uid=admin,ou=system</prop>
<prop key="java.naming.security.credentials">secret</prop>
<!--<prop key="kdc.entryBaseDn">ou=users,dc=example,dc=com</prop>-->
<!--<prop key="kdc.java.naming.security.credentials">secret</prop>-->
<!--<prop key="changepw.entryBaseDn">ou=users,dc=example,dc=com</prop>-->
<!--<prop key="changepw.java.naming.security.credentials">secret</prop>-->
<!-- Set this key to a space delimited set of attributeType descriptions
and their OID's if you want an attributeType to be handled as
binary content.
The server will use the schema to derive the set of attributeTypes
to treat as binary. The union if the values you provide here
will be taken as the set of binaries. Note to be consistent you
must add both the OID and all the names an attributeType can have.
-->
<!--
<prop key="java.naming.ldap.attributes.binary"></prop>
-->
</props>
</property>
</bean>
<bean id="configuration" class="org.apache.directory.server.configuration.MutableServerStartupConfiguration">
<property name="workingDirectory" value="example.com" />
<!-- Uncomment below to have the server load entries on startup! -->
<!-- ldifDirectory property can point to a relative file, directory or -->
<!-- can point to an absolute path to either using the URL path -->
<!-- notation: i.e. file:///Users/jack/apacheds/ldifs -->
<!-- Entries will optionally be filtered using LdifLoadFilters in the -->
<!-- order specified. The included Krb5KdcEntryFilter will filter -->
<!-- kerberos principals creating keys for them using their -->
<!-- userPassword attribute if present. -->
<!--<property name="ldifDirectory">
<value>example.ldif</value>
</property>
<property name="ldifFilters">
<list>
<bean class="org.apache.directory.server.protocol.shared.store.Krb5KdcEntryFilter"/>
</list>
</property>-->
<!-- the number of milliseconds before issuing a synch (flush to disk) -->
<!-- which writes out dirty pages back to disk. To turn off synchs all -->
<!-- together simply set this value to <= 0. Make sure you turn on -->
<!-- synchOnWrite for all partitions if you do choose to do this or else-->
<!-- writes may never persist to disk. -->
<property name="synchPeriodMillis" value="15000" />
<!-- limits searches by non-admin users to a max time of 15000 -->
<!-- milliseconds and has a default value of 10000 -->
<property name="maxTimeLimit" value="15000" />
<!-- limits searches to max size of 1000 entries: default value is 100 -->
<property name="maxSizeLimit" value="1000" />
<!-- maximum number of threads used by mina is set to 8: default is 4 -->
<property name="maxThreads" value="8" />
<property name="allowAnonymousAccess" value="false" />
<property name="accessControlEnabled" value="false" />
<property name="enableNtp" value="false" />
<property name="enableKerberos" value="false" />
<property name="enableChangePassword" value="false" />
<!--
It's more efficient to keep this feature turned off but you may not like
having the creatorsName and modifiersName contain OIDs instead of short
attributeType names instead. So if you want the creatorsName to change
from the normalized form which is the internal representation of
'0.9.2342.19200300.100.1.1=admin,2.5.4.11=system'
to a more human readabile form like:
'uid=admin,ou=system'
then set this property to true.
-->
<property name="denormalizeOpAttrsEnabled" value="false" />
<property name="ldapPort" value="10389" />
<property name="systemPartitionConfiguration" ref="systemPartitionConfiguration" />
<property name="contextPartitionConfigurations">
<set>
<ref bean="examplePartitionConfiguration"/>
<ref bean="OnRelayPartitionConfiguration"/>
</set>
</property>
<property name="bootstrapSchemas">
<set>
<bean class="org.apache.directory.server.core.schema.bootstrap.AutofsSchema"/>
<bean class="org.apache.directory.server.core.schema.bootstrap.CorbaSchema"/>
<bean class="org.apache.directory.server.core.schema.bootstrap.CoreSchema"/>
<bean class="org.apache.directory.server.core.schema.bootstrap.CosineSchema"/>
<bean class="org.apache.directory.server.core.schema.bootstrap.ApacheSchema"/>
<bean class="org.apache.directory.server.core.schema.bootstrap.CollectiveSchema"/>
<bean class="org.apache.directory.server.core.schema.bootstrap.InetorgpersonSchema"/>
<bean class="org.apache.directory.server.core.schema.bootstrap.JavaSchema"/>
<bean class="org.apache.directory.server.core.schema.bootstrap.Krb5kdcSchema"/>
<bean class="org.apache.directory.server.core.schema.bootstrap.NisSchema"/>
<bean class="org.apache.directory.server.core.schema.bootstrap.SystemSchema"/>
<bean class="org.apache.directory.server.core.schema.bootstrap.ApachednsSchema"/>
<bean class="com.onrelay.ldap.schema.PreferenceSchema"/>
<bean class="com.onrelay.ldap.schema.MbxSchema"/>
</set>
</property>
<property name="extendedOperationHandlers">
<list>
<bean class="org.apache.directory.server.ldap.support.extended.GracefulShutdownHandler"/>
<bean class="org.apache.directory.server.ldap.support.extended.LaunchDiagnosticUiHandler"/>
</list>
</property>
<property name="interceptorConfigurations">
<list>
<bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
<property name="name" value="normalizationService" />
<property name="interceptor">
<bean class="org.apache.directory.server.core.normalization.NormalizationService" />
</property>
</bean>
<bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
<property name="name" value="authenticationService" />
<property name="interceptor">
<bean class="org.apache.directory.server.core.authn.AuthenticationService" />
</property>
</bean>
<bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
<property name="name" value="referralService" />
<property name="interceptor">
<bean class="org.apache.directory.server.core.referral.ReferralService" />
</property>
</bean>
<bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
<property name="name" value="authorizationService" />
<property name="interceptor">
<bean class="org.apache.directory.server.core.authz.AuthorizationService" />
</property>
</bean>
<bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
<property name="name" value="defaultAuthorizationService" />
<property name="interceptor">
<bean class="org.apache.directory.server.core.authz.DefaultAuthorizationService" />
</property>
</bean>
<bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
<property name="name" value="exceptionService" />
<property name="interceptor">
<bean class="org.apache.directory.server.core.exception.ExceptionService" />
</property>
</bean>
<bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
<property name="name" value="schemaService" />
<property name="interceptor">
<bean class="org.apache.directory.server.core.schema.SchemaService" />
</property>
</bean>
<bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
<property name="name" value="subentryService" />
<property name="interceptor">
<bean class="org.apache.directory.server.core.subtree.SubentryService" />
</property>
</bean>
<bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
<property name="name" value="operationalAttributeService" />
<property name="interceptor">
<bean class="org.apache.directory.server.core.operational.OperationalAttributeService" />
</property>
</bean>
<bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
<property name="name" value="collectiveAttributeService" />
<property name="interceptor">
<bean class="org.apache.directory.server.core.collective.CollectiveAttributeService" />
</property>
</bean>
<bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
<property name="name" value="eventService" />
<property name="interceptor">
<bean class="org.apache.directory.server.core.event.EventService" />
</property>
</bean>
</list>
</property>
</bean>
<!-- use the following partitionConfiguration to override defaults for -->
<!-- the system partition -->
<bean id="systemPartitionConfiguration" class="org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration">
<property name="name" value="system" />
<property name="cacheSize" value="100" />
<property name="suffix" value="ou=system" />
<!-- the optimizer is enabled by default but may not always be what -->
<!-- you want if your queries are really simple -->
<property name="optimizerEnabled" value="true" />
<!--
Synchronization on writes does not wait for synch operations
to flush dirty pages. Writes persist immediately to disk at
a cost to performance with increased data integrity. Otherwise
the periodic synch operation will flush dirty pages using the
synchPeriodMillis parameter in the main configuration.
-->
<property name="synchOnWrite" value="true" />
<property name="indexedAttributes">
<set>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="ou" />
<property name="cacheSize" value="100" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="uid" />
<property name="cacheSize" value="100" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="objectClass" />
<property name="cacheSize" value="100" />
</bean>
</set>
</property>
<property name="contextEntry">
<value>
objectClass: top
objectClass: organizationalUnit
objectClass: extensibleObject
ou: system
</value>
</property>
</bean>
<bean id="examplePartitionConfiguration" class="org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration">
<property name="name" value="example" />
<property name="cacheSize" value="100"/>
<property name="suffix" value="dc=example,dc=com" />
<!-- the optimizer is enabled by default but may not always be what -->
<!-- you want if your queries are really simple -->
<property name="optimizerEnabled" value="true" />
<!--
Synchronization on writes does not wait for synch operations
to flush dirty pages. Writes persist immediately to disk at
a cost to performance with increased data integrity. Otherwise
the periodic synch operation will flush dirty pages using the
synchPeriodMillis parameter in the main configuration.
-->
<property name="synchOnWrite" value="true" />
<property name="indexedAttributes">
<set>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="dc" />
<property name="cacheSize" value="100" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="ou" />
<property name="cacheSize" value="100" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="krb5PrincipalName" />
<property name="cacheSize" value="100" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="uid" />
<property name="cacheSize" value="100" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="objectClass" />
<property name="cacheSize" value="100" />
</bean>
</set>
</property>
<property name="contextEntry">
<value>
objectClass: top
objectClass: domain
objectClass: extensibleObject
dc: example
</value>
</property>
</bean>
<bean id="OnRelayPartitionConfiguration" class="org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration">
<property name="name" value="onrelay" />
<property name="cacheSize" value="5000"/>
<property name="suffix" value="dc=onrelay,dc=com" />
<!-- the optimizer is enabled by default but may not always be what -->
<!-- you want if your queries are really simple -->
<property name="optimizerEnabled" value="true" />
<!--
Synchronization on writes does not wait for synch operations
to flush dirty pages. Writes persist immediately to disk at
a cost to performance with increased data integrity. Otherwise
the periodic synch operation will flush dirty pages using the
synchPeriodMillis parameter in the main configuration.
-->
<property name="synchOnWrite" value="true" />
<property name="indexedAttributes">
<set>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="uid" />
<property name="cacheSize" value="1000" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="sn" />
<property name="cacheSize" value="5000" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="gn" />
<property name="cacheSize" value="5000" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="cn" />
<property name="cacheSize" value="1000" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="objectclass" />
<property name="cacheSize" value="100" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="prefkey" />
<property name="cacheSize" value="100" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="switchid" />
<property name="cacheSize" value="100" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="primaryextention" />
<property name="cacheSize" value="1000" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="telephonenumber" />
<property name="cacheSize" value="5000" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="mobilenumber" />
<property name="cacheSize" value="100" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="linenumber" />
<property name="cacheSize" value="100" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="mbxunifiedvminternalnumber" />
<property name="cacheSize" value="100" />
</bean>
<bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
<property name="attributeId" value="mbxunifiedvmddi" />
<property name="cacheSize" value="100" />
</bean>
</set>
</property>
<property name="contextEntry">
<value>
objectClass: top
objectClass: domain
objectClass: extensibleObject
dc: example
</value>
</property>
</bean>
<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="javax.naming.directory.Attributes">
<bean class="org.apache.directory.server.core.configuration.AttributesPropertyEditor"/>
</entry>
</map>
</property>
</bean>
</beans>