Hitachi

uCosminexus Application Server System Design Guide


8.7.2 Caching static contents

In a Web container, the static contents can be saved in the memory (cache). Once the static contents are accessed, they are saved in the memory. This helps to reduce the frequency of subsequent access to the file system and enhance the response speed.

The method of tuning required for caching the static contents is explained below.

The following items can be tuned:

Each of these items is explained below. You can set the above items for each Web container and Web application. The Web application settings override the Web container settings. If you want to specify a default value for the entire J2EE server, specify the value for each Web container and if you want to specify detailed settings, specify the value for each Web application.

Tip

Relationship with the estimation of the memory size

In the static contents cache, the memory is used to enhance the response speed. When this functionality is used, it is important to tune the size according to the memory size that can be used in the server.

Set the size of the memory used for the static contents cache for each Web application. The sum total of all memory sizes specified for each Web application is the maximum memory size that can be used for the caching the static contents in the entire J2EE server. To use this functionality, therefore, add the total value of the memory size specified for each Web application, for estimating the memory size required in the J2EE server.

Organization of this subsection

(1) Selecting whether to cache the static contents

The static contents caching is a functionality that is not used by default. You need to change the parameters if you want to use this functionality.

The use of static contents cache can be set for each Web container and Web application. The Web application settings override the Web container settings. If, however, the settings are forcibly disabled in the Web container, the Web application settings will also be disabled. The settings can be forcibly disabled in the following cases:

(2) Maximum size of the memory used for the static contents cache

To cache the static contents, you can set the size of the memory to be used for each Web application. If the total size of the cache becomes more than the size specified in the respective Web application, the time that is not accessed, is deleted from the largest cache. Deletion continues until the total cache size falls below the size that was set.

The guidelines for setting the memory size are explained below:

Guidelines for setting the memory size
  • Set the maximum value of the total size of the static contents contained in the Web application.

  • The optimum size to be specified differs depending on the contents of the Web application. After setting the size, estimate the response speed of the request for the static contents and find the optimum size of the cache that will give the best response speed.

(3) Maximum file size of the static contents for caching

You can set the maximum file size of the static contents to be saved in the static contents. When the maximum size has been set, the contents of the file that exceed the maximum size are not saved in the cache, but are retrieved from the file system every time they are used.

The guidelines for setting the file size are explained below:

Guidelines for setting the file size
  • From the static contents contained in the Web application, specify a file size that is no more than the maximum file size.

  • Specify a value keeping in mind that the cache of static contents that does not have a high access frequency is not destroyed due to the cache of large size static contents.

(4) Check the operation status of the static contents

You can check the operation status of the static contents from details in the message KDJE39234-I that is output when the Web application is stopped. Tune all the parameters as required, according to the total size of the static contents and the total number of contents saved in the cache that is output to the above message.