How to ensure stable response times in BusinessWorks 5.X and BusinessWorks 6.X
In context where BusinessWorks exposes synchronous services like WEB Services, REST Services or JMS request / reply services it is generally important to have short response times and this to be consistent over time.
But BusinessWorks is a Java application and can be impacted by the Garbage Collection mechanism.
The default Java Garbage Collector is single threaded and this can lead to situation where the Java Virtual Machine stop processing for tenth of seconds, I have seen up to two minutes in performance tests, and this lead to a situation where the BusinessWorks engine freeze during that time.
If you are curious about this I suggest to search for ‘Stop the world Garbage Collection’ on forums like Stack Overflow.
In recent ORACLE JVM version there is a new Garbage Collector, called G1, that works in a multi-threaded mode. Instead of stopping the JVM periodically to do a big garbage collection, this mechanism does a lot of small garbage collections in the background, without stopping the JVM (or only for a short period of time), to ensure minimal disruption in processing.
This article explain how to enable G1 Garbage Collector (‘G1GC’) in BusinessWorks 5.X and BusinessWorks 6.X environments. This apply only for servers running under Linux, Windows and Solaris, while in other environments BusinessWorks is using other JVMs.
In BusinessWorks 5.X this can be done using the following approach :
1) Edit bwengine.tra file (to be done on all machines) to add the following line at the end of the file (or update the existing value of the java.extended.properties to include the option below) :
2) Redeploy all the applications for the new parameter to be taken into account.
Note : in case some applications would be using specific .tra files, that set the java.extended.properties property with a specific value, you will have to update the mechanism used to create those files to include the mentioned property.
In BusinessWorks 6.X this can be done using the following approach:
1) Edit bwappnode.tra file (to be done on all machines) to update the existing value of the java.extended.properties property to include the ‘-XX:+UseG1GC’ option, for example:
java.extended.properties=-Xmx1024m -Xms128m -XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError
2) Restart the appnodes.
Note : in case some appnodes would be using specific .tra files, that set the java.extended property with a specific value, you will have to update these files one by one.
Note that in BusinessWorks Container Edition the appnode configuration in the Docker base image is configured by default to use G1GC.
Things to keep in mind
In theory using G1GC might increase a bit the cpu usage, but I never heard complains on this from TIBCO customers using G1GC with Java 1.8.
Useful to know in AIX environment
In AIX environment where the IBM JVM is used the equivalent of G1GC seems to be the ‘gencon’ garbage collector.
According to IBM online documentation this can be enabled with the following command line option:
This option can be set using the java.extended.properties property has mentioned above.