Administer > Smart Analytics Administration > Best practices > Improve Smart Analytics query performance

Improve Smart Analytics query performance

User Role: Administrator

Caching some match fields into memory can accelerate the query speed of Smart Analytics. To achieve this, you can modify the configuration files and corresponding sections of the content servers for which you want to accelerate the query speed.

To configure cache settings for match fields, follow these steps:

  1. Open the <SmartAnalytics>/Content<x>/Content<x>.cfg files of the content servers for which you want to accelerate the query speed.

  2. Configure the cache settings for match fields as follows:

    [server]
    NodeTableCacheFields=True
    NodeTablePrepopulateCache=True
    
    //--------------------------- Cache Settings ---------------------------------//
    
    //Maximum size of the field cache (in KB). Increasing the size of the cache can improve performance. However, you must ensure the host machine has sufficient available memory.
    [MemoryCache]
    EvictWhenFull=True
    MaxSize=1024000
    
    
    [FieldProcessing]
    23=SetCachedFields
    
    [SetCachedFields]
    Property=CachedFields
    PropertyFieldCSVs=*/*_MATCH,*/IMPORTMAGICEXTENSION
    
    
    //---------------------------Properties-------------------------------//
    
    [CachedFields]
    MemCachedType=True
    
  3. Restart the content servers for which you modified the configuration files.

    Note It takes a while for the content servers to get restarted. For example, it takes about 35 minutes if you restart content servers on an environment with 1G memory cache. You can monitor the restart status by checking the <Smart Analytics>/Content<x>/logs/application.log file. If the caching is successful, you can see log information similar to the following:

    22/09/2016 16:45:50 [1] 30-Normal: Indexing nodetable memory information for 2268213 documents.
    22/09/2016 16:46:26 [1] 30-Normal: Indexing information from documents 10% complete.
    22/09/2016 16:47:35 [1] 30-Normal: Indexing information from documents 20% complete.
    22/09/2016 16:49:31 [1] 30-Normal: Indexing information from documents 30% complete.
    22/09/2016 16:53:39 [1] 30-Normal: Indexing information from documents 40% complete.
    22/09/2016 16:58:10 [1] 30-Normal: Indexing information from documents 50% complete.
    22/09/2016 17:02:05 [1] 30-Normal: Indexing information from documents 60% complete.
    22/09/2016 17:06:28 [1] 30-Normal: Indexing information from documents 70% complete.
    22/09/2016 17:10:51 [1] 30-Normal: Indexing information from documents 80% complete.
    22/09/2016 17:15:11 [1] 30-Normal: Indexing information from documents 90% complete.
    22/09/2016 17:19:34 [1] 30-Normal: Populated nodetable memory cache.
    22/09/2016 17:19:34 [1] 30-Normal: Writing out stateinfo
    22/09/2016 17:19:34 [1] 00-Always: Initialized memory.