This documentation supports the 19.02 version of Service Request Management.

To view the latest version, select the version from the Product version menu.

Using the mid tier prefetch utility to improve performance

To prevent degradation of performance while applications and forms are loaded to a cache, use the prefetch configuration utility with the mid tier when configuring the application. Loading applications and forms in memory can cause a significant delay for the first user in a "permission type."

You can use a PERL-based utility (prefetch.pl) to make calls to the mid tier URLs from the command line and therefore offload the performance hit of caching. With this prefetch.pl utility, the cache can be preloaded during the mid tier startup.

Tips for using prefetch with Apache Tomcat

The more forms you add to prefetch, the more time you must allow for a graceful shutdown of Tomcat. If Tomcat crashes or the server is shut down before Tomcat saves any open prefetch files, the prefetch restarts upon reboot, leading to slow response and a possible system crash if others try to use it while it is fetching again. 

Remember these tips when using prefetch with Apache Tomcat:

  • Increase the Tomcat shutdown time and thread stack sizes to enable the efficient serialization of your forms. This action gives Tomcat extra time to save prefetch files.
  • Raise the maximum memory size of Tomcat (for example, 1024 MB).
  • Flush the Tomcat cache. Restart Tomcat, and let it run. This action could take several hours to finish.
  • Monitor the amount of memory actually needed and lower the number accordingly.
  • Include only the front-end user facing forms in the prefetch.
  • Include the user name that is the most common group combination in the prefetch file. Using the Admin user might not be appropriate as the users belonging to other groups triggers the HTML generation on the mid tier.
  • Watch the Tomcat process to make sure you are not keeping the JVM busy with the memory swap. If possible, allocate the min and max as 2 GB so that the Tomcat process starts up with the full memory available.
    Because the memory requirements depend on how many forms are being loaded, you must calculate the amount of memory needed based on the application stack and the usage of your deployment.

For more information about Tomcat configuration settings, see About Tomcat configuration settings . For more information about persistent cache option, see  About the Persistent Cache option .

Prefetch components and usage

The prefetch.pl utility uses the following components:

Component

Description

StartServlet

Contains the main code

prefetchConfig.xml

Main configuration file found in <midTierInstall>/WEB-INF/classes

prefetchConfig.xsd

XML schema definition (XSD) for the .xml file, found in the <midTierInstall> folder

Configuration file format

The format of the prefetch.pl utility configuration file is as follows:

Section

Example code

Header

<?xml version="1.0" encoding="UTF-8"?> <midtier-prefetch-config  xmlns="http://www.bmc.com/remedy/midtier/700">

Authentication — One or more users that determines the permission-type cache. No password is required.

<prefetch-user>
	<user-name>SupportUser</user-name>
	<locale>en_US</locale>

Server, applications and forms — Applications can contain 0+ forms. Forms can exist individually at a server level.

<prefetch-server>
	<server-name>arserver</server-name>
	<prefetch-app>
		<app-name>Sample</app-name>
		<prefetch-form>
		<form-name>Home Page</form-name>
		</prefetch-form>
...
...
</prefetch-app>
	<prefetch-form>
		<form-name>Home Page</form-name>
		</prefetch-form>
	</prefetch-server>
</prefetch-user>

Footer

</midtier-prefetch-config>

Prefetch usage considerations

Note the following when implementing the prefetch utility:

  • Forms are cached differently, depending upon whether they are accessed using a call to the application (/arsys/apps/<ARServer>/<appName>/ <formName>) or the forms directly (/arsys/forms/<ARServer>/<formName>). For environments where either call is possible, both methods should be covered in the .xml file:

    ... <prefetch\-server> <serverName>ServerName</server\-name> <prefetch\-app> <app\-name>AppName</app\-name> <prefetch\-form> <form\-name>FormName</form\-name> </prefetch\-form> </prefetch\-app> </prefetch\-server> <prefetch\-server> <server\-name>ServerName</server\-name> <prefetch\-form> <form\-name>FormName</form\-name> </prefetch\-form> </prefetch\-server> ...
  • Specifying an application without at least one form causes the mid tier to cache all of the forms in that application.

    .... <prefetch\-server> <server\-name>ServerName</server\-name> <prefetch\-app> <app\-name>AppName</app\-name> </prefetch\-app> </prefetch\-server> ...
  • You can see the prefetch activity in the mid tier logs in the following situations:
    • The performance category is selected.
    • The Log Level is set to Fine.

      Apr 12, 2007 1:05:57 PM com.remedy.arsys.prefetch.PrefetchTask run
         INFO: START prefetch
         Apr 12, 2007 1:06:14 PM com.remedy.arsys.goat.Form get
         FINE: Form: Constructing for missing key Form:atlwin01/AR System User Preference
         Apr 12, 2007 1:06:17 PM com.remedy.arsys.goat.Form <init>
         FINE: API form time = 2735
         Apr 12, 2007 1:06:17 PM com.remedy.arsys.goat.Form get
         FINE: Form: Construction for key Form:atlwin01/AR System User Preference took 2765
         Apr 12, 2007 1:06:17 PM com.remedy.arsys.goat.Form$CachedFieldMap <init>
         FINE: Form.CachedFieldMap: Constructing for missing key atlwin01/AR System User Preference/Admin
         Apr 12, 2007 1:06:17 PM com.remedy.arsys.goat.Form$CachedFieldMap <init>
         FINE: API field key time = 31
         Apr 12, 2007 1:06:22 PM com.remedy.arsys.goat.Form$CachedFieldMap <init>
         FINE: API field time = 4797
         ...
         ...
         FINE: Using the preference server atlwin01 form AR System User Preference for user Demo
         Apr 12, 2007 1:06:22 PM com.remedy.arsys.goat.Form get
         FINE: Form: Constructing for missing key Form:atlwin01/Sample:Classes
         Apr 12, 2007 1:06:24 PM com.remedy.arsys.goat.Form <init>
         FINE: API form time = 2031
         ...
      
         Apr 12, 2007 1:06:30 PM com.remedy.arsys.goat.field.FieldGraph instantiateFields
         FINE: FieldGraph: Populated fields/workflow for key Admin|atlwin01/Sample:Classes/536880381/N, took 5438
         Apr 12, 2007 1:06:30 PM com.remedy.arsys.goat.Globule init
         FINE: Globule: Compressed data type text/html; charset=UTF-8 - was 17445 bytes, now 3718 bytes
         Apr 12, 2007 1:06:30 PM com.remedy.arsys.goat.ActiveLink getBound
         FINE: COMPILE formactivelink time = 0
         Apr 12, 2007 1:06:30 PM com.remedy.arsys.goat.ActiveLink getBound
         FINE: COMPILE formactivelink time = 0
         Apr 12, 2007 1:06:31 PM com.remedy.arsys.goat.menu.Menu getMenuFromServer
         FINE: API Get Menu time = 421
         Apr 12, 2007 1:06:31 PM com.remedy.arsys.goat.Globule init
         FINE: Globule: Compressed data type text/js; charset=UTF-8 - was 5967 bytes, now 1972 bytes
         Apr 12, 2007 1:06:31 PM com.remedy.arsys.prefetch.PrefetchWorkerImpl fetchForUser
         FINE: successful prefetch - server:atlwin01||form:Sample:Classes||username:Demo||appname:Sample||view:null||locale:en_US||timezone:null took 8687 milliseconds.
         Apr 12, 2007 1:06:31 PM com.remedy.arsys.goat.Form get
         FINE: Form: Constructing for missing key Form:atlwin01/AR Sample Application: Console
         ...
         ...
         Apr 12, 2007 1:06:31 PM com.remedy.arsys.prefetch.PrefetchTask run
         INFO: END prefetch
Was this page helpful? Yes No Submitting... Thank you

Comments