Configuring the mid tier preload and prefetch


The following performance related services in the mid tier assist in the prebuilding process:

You can manually configure the first two services. The statistics service runs automatically and requires no administration.

The following sections about these services assume that the Enable Cache Persistence option is set to on. For more information about cache persistence, see Configuring-mid-tier-cache-serialization.

When the mid tier loads a necessary object into memory with Enable Cache Persistence  set to on, the mid tier tries to load the object from disk first. If the object is not available from disk, the mid tier loads the object from the AR System server and constructs the object in memory. The object is then serialized to disk. On subsequent usage of the same object, if it is not already in memory, the object is retrieved from disk unless the object’s definition has changed according to the Definition Change Check Interval parameter. For more information, see  Using the miscellaneous service.

Using the preload service

If the preload service is turned on for an AR System server as configured in the mid tier, the preload service preloads all of the active links and menus when the mid tier starts. It then preloads all of the AR System forms that contain active links up to the limit as defined by the ehcache. The forms with active links are preloaded because any form with active links must be a user-facing form for some use case. The users access these links at some point, so they should be preloaded.

When a browser user requests a form from the mid tier, the mid tier performs the final process of compiling the form into DHTML because this is when the mid tier can determine a view, locale, and permission group. This final process happens quickly because all related form objects exist in memory.

The following figure shows Preload activated on the Edit AR Server page of the Mid Tier Configuration Tool.

AR Server Settings page of the Mid Tier Configuration Tool
PreloadService.jpg

To run preload on a production system

  1. In the Mid Tier Configuration Tool, click Cache Settings.
  2. Select the Enable Cache Persistence check box.
  3. Turn on preload as follows:
    1. Click AR Server Settings.
    2. Select the server to edit, and click Edit.
    3. Select the Pre-Load check box next to the server name.
    4. Click Save AR Server.
  4. Allow preload to finish preloading all the user-facing AR System forms.
  5. Turn off preload.

Using this procedure allows the statistics service to load only the objects that correspond to the actual usage of the system into the mid tier memory. After the preload service has run once, all of the relevant objects are written to disk (because Cache Persistence is enabled). By turning off the preload service, the statistics service has full memory access to load only those objects that are collected in actual usage. The viewstats.dat file reflects the actual usage of forms, views and locales. The Mid Tier will be able to fully build the views in cache when preload builds a partial view. As an alternate method, you can repeat this procedure if the applications on the AR System server have changed, or if you have flushed the mid tier cache.

Using the prefetch service

The prefetch service has been available since BMC Remedy Action Request System 7.0 and is kept for backward compatibility. The preload service replaces prefetch. You can use prefetch instead of the preload service, but do not use both because preload already loads a superset of the data as specified in the prefetch file. For information about disabling prefetch, see Recommended caching setup and procedures in Excerpt named mid_tier_cache_prefetch was not found in document xwiki:Service-Management.On-Premises-Deployment.Remedy-Deployment.brid1808._inclusionsLibrary_brid._brid_2NW_LinksLibrary.WebHome..

If the midTierInstallationDirectory/WEB-INF/classes/prefetchConfig.xml file is not empty, all of the user-facing forms as specified in the prefetchConfig.xml file are preloaded into memory. (The prefetch service uses the same code module as the preload service for the loading of BMC Remedy AR System definitions.) All of these forms are serialized to disk when the Enabled Cache Persistence option is On. The forms listed in the prefetchConfig.xml file are a subset of the forms that the preload service preloads up to the limit as defined by the ehcache property.

Note

Use prefetch only when you know the specific set of user-facing forms for your use cases. Otherwise, use the preload service because it is easier to use.

Optionally, you can access the prefetchConfig.xml file located at the Mid Tier installation location <AR System Install directory>\ARSystem\midtier\WEB-INF\classes\prefetchConfig.xml. For information about accessing the Mid Tier Configuration Tool, see Accessing the Mid Tier Configuration Tool.

Cache Settings page of the Mid Tier Configuration Tool
CacheSetting.JPG

About the statistics service

When a browser user accesses a form, the statistics service collects the information necessary to build a view for the target form. The statistics service builds a quintuple list (AR System server name, form name, view name, locale, user group combination), sorted by the frequency of access, with the most frequently accessed form listed first.

When the mid tier is restarted (a Tomcat restart) and after the preload or prefetch service has finished, the statistics service loads this list and the corresponding DHTML into memory. They are loaded in the order given by the list using a thread with a lower-than-normal priority, allowing the mid tier to service browser users in parallel.

After the statistics service finishes loading, the forms and corresponding DHTML are loaded into memory. This allows the mid tier to respond quickly to browser requests as dictated by the statistics of actual usage.

The collected statistics are serialized to the
midTierInstallationDirectory/WEB-INF/classes/viewStat.dat file. This data is continually validated as the statistics are collected. Data that is no longer applicable is removed (such as data for an AR System server that was removed from the Mid Tier configuration). You can also view the collected data through the hidden JSP config_cache_adv.jsp file by using the Mid Tier Configuration Tool. (After you have logged into the Configuration Tool, you need to enter the JSP name into the URL bar of your browser because this JSP is hidden.)

Using the miscellaneous service 

The mid tier also provides a cache synchronization service to synchronize the memory and disk cache with the definitions stored in the AR System server. The frequency of synchronization is configurable through the Cache Settings page of the Mid Tier Configuration Tool.

For a production system where the definitions are unchanged or if there is a specific period for rolling out changes, turn off the cache synchronization service. Use Sync Cache after the changes are in place.

Cache Settings page of the Mid Tier Configuration Tool
CacheSettings_SyncCache.jpg

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*