You're viewing Apigee Edge documentation.
Go to the
Apigee X documentation. info
This document explains how to enable String Deduplication on the Apigee Edge’s Message Processors.
String Deduplication is a Java feature that helps you to save memory occupied by duplicate String objects in Java applications. It reduces the memory footprint of String objects in Java heap memory by making the duplicate or identical String values share the same character array.
Apigee Edge Message Processor is a Java-based component. Using String Deduplication in a Message Processor can improve the performance of your API Proxies by reducing the memory usage, especially if the API Proxies make heavy use of Strings.
The String Deduplication feature can be used only with G1 Garbage Collector (G1GC) in Java applications. If you want to enable this feature on the Message Processor, then you need to already have G1GC enabled or enable both G1GC and String Deduplication together on the Message Processor.
Before you begin
- If you aren’t familiar with G1GC, read Getting started with the G1 Garbage Collector
- If you aren't familiar with String Deduplication, read String Deduplication of G1 Garbage Collector
- If you aren't familiar with enabling G1GC on edge Message Processors, read Enable G1GC on the Message Processors.
- If you aren’t familiar with configuring properties for Edge on Private Cloud, read How to configure Edge.
Enabling String Deduplication on the Message Processors
This section explains how to enable the String Deduplication feature on the Edge Message
Processors. String Deduplication can be enabled through the property
useStringDeduplication
on the Message Processor component. By default, this
property is set to false on the Message Processors. To configure any property on the Message
Processor, use the token according to the syntax described in
How to configure Edge.
To enable String Deduplication on the Message Processors, perform the following steps:
Locate token for useStringDeduplication property
The following steps describe how to locate the token for useStringDeduplication:
-
Search for the
useStringDeduplication
property in the Message Processor source directory/opt/apigee/edge-message-processor/source
using the following command:grep -ri "useStringDeduplication" /opt/apigee/edge-message-processor/source
-
The output of this command shows the token for Message Processor’s property
useStringDeduplication
as follows:/opt/apigee/edge-message-processor/source/conf/system.properties:useStringDeduplication={T}conf_system_useStringDeduplication{/T}
Where the string between the
{T}{/T}
tags is the name of the token that you can set in the Message Processor's.properties
file. Thus, the token for the propertyuseStringDeduplication
is as follows:conf_system_useStringDeduplication
Enable String Deduplication on the Message Processors
The following steps describe how to enable String Deduplication on the Apigee Message Processors:
-
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
-
Add the following line to this file:
conf_system_useStringDeduplication=true
- Save your changes.
-
Ensure this properties file is owned by the
apigee
user. For example:chown apigee:apigee /opt/apigee/customer/application/message-processor.properties
-
Restart the Message Processor using the following command:
/opt/apigee/apigee-service/bin/apigee-service edge-message-processor restart
- If you have more than one Message Processor, repeat these steps on all the Message Processors.
Verifying String Deduplication on the Message Processors
This section explains how to verify that the String Deduplication has been successfully enabled on the Message Processors.
Even though you use the token conf_system_useStringDeduplication
to enable String
Deduplication on the Message Processor, you need to verify that the actual property
useStringDeduplication
has been set with the new value as follows:
-
Search for the property
useStringDeduplication
in the/opt/apigee/edge-message-processor/conf
directory and check to see that it has been set with the new value. For example:grep -ri "useStringDeduplication" /opt/apigee/edge-message-processor/conf
-
If String Deduplication is enabled successfully on the Message Processor, then the previous
command shows the new value in the
system.properties
file.The sample result from the previous command after you have enabled String Deduplication on the Message Processor is as follows:
/opt/apigee/edge-message-processor/conf/system.properties:useStringDeduplication=true
In the example output, note that the property
useStringDeduplication
has been set with the new valuetrue
insystem.properties
. This indicates that String Deduplication is successfully enabled on the Message Processor. -
If you still see the old value for the property
useStringDeduplication
, then verify that you have followed all the steps outlined in Enabling String Deduplication on the Message Processors correctly. If you have missed any step, repeat all the steps again correctly. - If you are still not able to enable String Deduplication, contact Apigee support.