Enabling cache monitoring

HCL Commerce provides a Dynamic Cache Monitor application for displaying cache statistics, edge side and disk statistics, cache entries, dependency IDs, and cache policy information. A Cache Monitor is an installable web application that provides a real-time view of the current state of dynamic cache.

Procedure

Install and open the Cache Monitor for each server for which you want to view cache statistics.
OptionDescription
Production environment: Liberty Server WebSphere Application Server V8.5.5 Liberty, (Store server and Search server) To configure the cache monitoring on WebSphere Application Server V8.5.5 Liberty within a Docker container:
  1. Create an XML file, cachemonitor.xml, containing the following configuration.
    <server>
      <featureManager>
        <feature>webCacheMonitor-1.0</feature>
        <feature>restConnector-1.0</feature>
        <feature>appSecurity-2.0</feature>
      </featureManager>
    
      <administrator-role>
        <user>wcsadmin</user>
      </administrator-role>
      
      <basicRegistry id="Cache Monitor" realm="Cache Monitor">
        <user name="wcsadmin" password="password"></user>
      </basicRegistry>
    </server> 
    
    Note:
    • The restConnector-1.0 and appSecurity-2.0 features are required to run the Cache Monitor securely.
    • Set the user name and password values for basic authentication to access the Cache Monitor application.
    • If you use this basic authentication, ensure that your server.xml configuration file is located at Liberty_installdir/usr/servers/default/server.xml and does not already contain an empty basicRegistry configuration. For example, <basicRegistry></basicRegistry>. If it does, this empty configuration can be commented out or removed.
  2. Copy the cachemonitor.xml configuration file into the Liberty /configDropins/overrides/ directory within your Docker container.

    This can be done within your Dockerfile configuration file via the COPY command during your Docker container deployment.

    For example:
    COPY cachemonitor.xml /opt/WebSphere/Liberty/usr/servers/default/configDropins/overrides/
  3. Ensure that you have network access to the Cache Monitor application.

    In a Kubernetes environment, the Cache Monitor needs access to be granted for each pod by using the port-forward command.

    For example:
    kubectl port-forward POD_NAME -n commerce 8483:8483
    Warning: When enabling access, ensure that this URL is not made accessible to those outside of your organization.
  4. Access the Cache Monitor application.
    For the Store server, you can access the Cache Monitor in your browser by navigating to https://localhost:8483/cachemonitor.
    Note: For the Search server, the default port is 3738.
Production environment: WebSphere Application Server (Transaction server) To configure the cache monitoring on WebSphere Application Server within a Docker container:
  1. Before deployment, utilize the following Transaction server Run Engine commands by entering the following into your Docker container Dockerfile configuration files.
  2. Ensure that you have network access to the Cache Monitor application.

    In a Kubernetes environment, the Cache Monitor needs access to be granted for each pod by using the port-forward command.

    For example:
    kubectl port-forward POD_NAME -n commerce 5080:5080
    Warning: When enabling access, ensure that this URL is not made accessible to those outside of your organization.
Developer environment: To configure the cache monitoring within your development environment:
Complete the following steps fo WebSphere Application Server to enable the cache monitoring. All WebSphere Dynacaches are accessible through the Extended Cache Monitor user interface. It lets you inspect every item in the cache as well as clear (invalidate) specific cache entries or entire caches.
  1. Using WebSphere Application Server Administrative Console, click Applications > New Application.
  2. In the New Application window, click New Enterprise Application > Browse and locate the CacheMonitor.ear file in the IBM\WebSphere\AppServer\installableApps directory.
  3. Click Next and select Fast Path installation. Select the installation options accept the default values and click Next.
  4. Map the modules to the servers, and select the application servers to be monitored. Click Next.
  5. Map security roles to users or groups. Click Next with default settings and click Finish. Go to WebSphere Application Server Administrative Console to start the cache monitor.
  6. Click Applications > Application Types > WebSphere enterprise applications and check the box next to Dynamic Cache Monitor. Click Start.
Enable the manager to utilize the Dynamic Cache Monitor.
  1. In the WebSphere Application Server Administrative Console, go to Applications > Application Types > Websphere Enterprise Applications.
  2. Search and click the Dynamic Cache Monitor. The wintitle Configuration screen for the Dynamic Cache Monitor is displayed.
  3. In the Detail Properties section click the link Security role to user/group mapping.
  4. Check the box next to Administrator and click the button at the top labeled Map users.
  5. Enter the administrator user in the Search string box and click the Search button.
  6. Your administrator user should show up in the Available list below.
  7. Select the user and click the Arrow to move it to the Selected list. Click OK button.
The manager can use Dynamic Cache Monitor as a result.
Access the Dynamic Cache Monitor
Access the cachemonitor using a URL similar to the following.
https://localhost:10041/cachemonitor
Note: For additional updates for the cache monitor, see Cache monitor. These updates are not required to view the Portal caches, and may prevent the display of those caches. Testing is suggested.