Tune Just-In-Time compilers

Java virtual machines (JVM) use Just-In-Time (JIT) compilers to compile Java byte codes into native instructions during server run time. A JIT compiler is a platform-specific compiler that generates machine instructions for each method as needed. These compilers can affect startup or runtime performance.


About this task

By default, the size of the JIT codetotal parameter for the WebSphere Commerce JVM is 128 MB. Sometimes, this size might not be sufficient for our application. Once the JIT cache is full, the JIT compilers stop the optimization for compiling code. The stopping of this optimization can affect application performance. By monitoring the JIT compiler usage and tuning the JIT codetotal parameter, we can avoid this performance impact.

Follow the directions for the appropriate server:


Procedure

Transaction server

  1. Configure the WebSphere Application Server settings to monitor the JIT compiler logs. By reviewing these log files, we can determine whether performance tuning is necessary.

    1. Open the WebSphere Application Server administrative console.

    2. Expand Servers > Server Types. Click WebSphere application servers. Click your server name.

    3. In the Server Infrastructure section, expand Java and Process Management. Click Process definition > Java Virtual Machine.

    4. In the Generic JVM arguments field, add the following parameter

        -Xjit:verbose,vlog=log_path

      Where log_path is the relative file path location for the JIT compiler log file.

    5. Click Apply.

    6. Click Save directly to the master configuration.

    7. Restart the WebSphere Application Server.

    After you restart the server, run WebSphere Commerce for a duration. Monitor the JIT log specified in the log_path. If the line <WARNING: JIT CACHES FULL> exists in the log file, tune the JIT codetotal parameter.

  2. Tune the codetotal parameter. Increase the codetotal size by changing the JVM generic parameters.

    1. In the WebSphere Application Server administrative console, expand Servers > Server Types. Click WebSphere application servers. Click your server name.

    2. In the Server Infrastructure section, expand Java and Process Management. Click Process definition > Java Virtual Machine.

    3. In the Generic JVM arguments field, increase the value for the -Xjit:codetotal parameter.

      Note: Do not tune the JIT codetotal value to be larger than the size that is necessary. By increasing the value for the codetotal parameter too much, a negative performance impact can occur. IBM recommends to set the value for the codetotal parameter to be only large enough to meet your application requirements.

    4. Click Apply.

    5. Click Save directly to the master configuration.

    6. Restart the WebSphere Application Server.

    Iterate this tuning process until the warning <WARNING: JIT CACHES FULL> no longer added to the JIT log file. When the JIT codetotal parameter is properly configured, disable the logging for the JIT compiler in the WebSphere Application administrative console. To disable this logging, remove the -Xjit:verbose,vloglog_path parameter from the Generic JVM arguments field.

Search, Store, Customization servers

The generic JVM arguments are used to configure and adjust how the JVM executes.The WebSphere Application Server Liberty profile is preconfigured with minimal settings defined. The following steps will direct you how to define custom generic JVM arguments such as heap settings for a Liberty server.

  1. Create a text file named jvm.options.

  2. Insert your generic JVM options, one per line, into this file.

  3. Depending on your preferences, we might configure a single JVM or all Liberty JVMs with your options file.

    1. To apply these settings to a single server, save jvm.options at: ${server.config.dir}/jvm.options

      1. In the Search server: /opt/WebSphere/Liberty/usr/servers/default/jvm.options

      2. In the Store server: /opt/WebSphere/Liberty/usr/servers/default/jvm.options

      3. In the Customization server: /opt/WebSphere/Liberty/usr/servers/default/jvm.options