Configuring heap memory size on the Message Processors

You're viewing Apigee Edge documentation.
Go to the Apigee X documentation.
info

Apigee Edge’s Message Processor is a Java-based component and uses a default heap memory size of 512 MB. However, the default heap memory size may not be sufficient for all use cases on Apigee Edge. You may need to tune the heap memory size for your Message Processors depending on your traffic and processing requirements or to address any memory-related issues.

The heap memory size of a Java application is controlled through the Java command line parameters -Xms (minimum heap size) and -Xmx (maximum heap size). On the Apigee Edge Message Processors, these are controlled through the properties bin_setenv_min_mem and bin_setenv_max_mem. You can read more about these properties in Modifying Java memory settings.

This document explains how to configure the heap memory size on Apigee Edge’s Message Processors.

Before you begin

Changing Heap memory size on the Message Processors

This section explains how to change heap memory size on the Message Processors. Minimum and maximum heap memory can be configured through the properties bin_setenv_min_mem and bin_setenv_max_mem on the Message Processor component.

To change heap memory size on the Message Processors, perform the following steps:

  1. Open the /opt/apigee/customer/application/message-processor.properties file on the Message Processor machine in an editor. If the file does not already exist, then create it. For example:
    vi /opt/apigee/customer/application/message-processor.properties
  2. Add the following lines to this file:
    bin_setenv_min_mem=minimum_heap_in_megabytes
    bin_setenv_max_mem=maximum_heap_in_megabytes

    For example, If you want to change minimum and maximum heap on the Message Processor to 1 GB and 2 GB respectively, then add the following lines to this file:

    bin_setenv_min_mem=1024m
    bin_setenv_max_mem=2048m
  3. Save your changes.
  4. Ensure this properties file is owned by the apigee user. For example:
    chown apigee:apigee /opt/apigee/customer/application/message-processor.properties
  5. Restart the Message Processor using the following command:
    /opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart
  6. If you have more than one Message Processor, repeat these steps on all the Message Processors.

Verifying Heap memory size on the Message Processors

This section explains how to verify if the heap memory changes have been successfully modified on the Message Processors.

Even though you used the properties bin_setenv_min_mem and bin_setenv_max_mem to change the heap memory size on the Message Processor, you need to verify that the actual Java command line parameters -Xms and -Xmx have been set with the new values as follows:

  1. Search to see if the command line parameters -Xms and -Xmx have been set with the new values for the Message Processor using the following command:
    ps -ef | grep message-processor | egrep -o 'Xms[0-9a-z]+|Xmx[0-9a-z]+' | tr '\r' ' '
  2. If the minimum and maximum heap memory have been changed on the Message Processor, then the previous command shows the new value listed for -Xms and -Xmx.

    The sample result from the previous command, after you have changed the minimum and maximum heap on the Message Processor, is as follows:

    Xms1024m
    Xmx2048m

    In the example output, note that the new values for minimum and maximum heap have been set.

  3. If you still see the old values for -Xms and -Xmx, then verify that you have followed all the steps outlined in Changing heap memory size on the Message Processors correctly. If you have missed any step, repeat all the steps again correctly.
  4. If you are still not able to change heap memory, contact Apigee Edge Support.

What’s next?