Oak Performance: To Update Oak Indexes in AEM 6.1 takes longer

in aem •  8 years ago  (edited)

Here's the fix that can be applied to make sure that Oak Indexes are done faster:

  1. For LuceneIndexProvider OSGi config - Enable CopyOnWrite
  2. On path /oak:index/lucene add a String property indexPath=/oak:index/lucene

Note: AEM 6.2 ships with the above changes - and the above fix is applicable for 6.1 on Oak > 1.2.11

Here's how you can measure the performance:

  1. Enable the Trace logs for "org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorContext.perf"
  2. Below are statements to look for in the logs:
Before the change:
*TRACE* [pool-6-thread-2]  org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorContext.perf  Closed writer for directory Lucene Index : OOTBlucene [took 32235ms]
*TRACE* [pool-6-thread-2]  org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorContext.perf  Closed directory for directory Lucene Index : OOTBlucene [took 32236ms]
*TRACE* [pool-6-thread-2]  org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorContext.perf  Overall Closed IndexWriter for directory Lucene Index : OOTBlucene  [took 32236ms]
After the change:
*TRACE* [pool-6-thread-1]  org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorContext.perf  Closed writer for directory Lucene Index :  OOTBlucene(/oak:index/lucene) [took 737ms]
*TRACE* [pool-6-thread-1]   org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorContext.perf  Closed directory for directory Lucene Index :  OOTBlucene(/oak:index/lucene) [took 738ms]
*TRACE* [pool-6-thread-1]   org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorContext.perf  Overall Closed IndexWriter for directory Lucene Index :  OOTBlucene(/oak:index/lucene) [took 738ms]
  1. See the time difference.
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!