Fine Tune JBoss or WildFly Configurations

By default, the  installer applies basic configurations to the JBoss or WildFly application server. With basic configurations, the performance of an application server might be less than optimal. To enhance the performance, we recommend fine-tuned configurations which you can apply by selecting “Apply Recommended Application Server Configuration” in the “Application Server Information” page of the installer wizard.
cim142
The fine-tune configurations described in this document are applicable only to JBoss 6.4 and Wildfly 8.2.1.
By default, the
Identity Manager
installer applies basic configurations to the JBoss or WildFly application server. With basic configurations, the performance of an application server might be less than optimal. To enhance the performance, we recommend fine-tuned configurations which you can apply by selecting “
Apply Recommended Application Server Configuration
” in the “
Application Server Information
” page of the installer wizard.
The configurations that are fine-tuned to improve the performance of the JBoss or WildFly application server are,
  • JVM Settings
  • HornetQ Settings
Recommended Configurations
This section covers the configurations that we recommend for improving the performance of the JBoss or WildFly application server. In case you have not applied the recommended configurations while installing the product, post-installation you can manually apply these recommended configurations on the application server.
  1. Set the JVM settings:
    • Windows
      1. Navigate to <JBOSS_HOME>/bin.
      2. Open
        standalone.conf.bat
        for editing.
      3. Set the JVM parameters in JAVA_OPTS with the following recommended values:
        • JVM Minimum Heap Size:
          512 MB
        • JVM Maximum Heap Size:
          4 GB
          If more than 4 GB is required, use the recommended settings described in Fine Tuning Garbage Collection.
        • Generic JVM Arguments:
          -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+UseCompressedOops -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true
        Example:
        set "JAVA_OPTS=-Xms512m -Xmx512m -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+UseCompressedOops -Djava.awt.headless=true -Dcom.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=true"
    • Linux
      1. Navigate to <JBOSS_HOME>/bin.
      2. Open
        standalone.conf
        for editing.
      3. Set the JVM parameters in JAVA_OPTS with the following recommended values:
        • JVM Minimum Heap Size:
          512 MB
        • JVM Maximum Heap Size:
          4 GB
          If more than 4 GB is required, use the recommended settings described in Fine Tuning Garbage Collection.
        • Generic JVM Arguments:
          -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+UseCompressedOops -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true
        Example:
        JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx512m -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+UseCompressedOops -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Djava.security.egd=file:/dev/./urandom -Dcom.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager=true"
  2. Set the HornetQ Server settings:
    HornetQ Server settings are applicable to a cluster setup, and not to a standalone installation. In a cluster, repeat this step (step 2) for all nodes.
    1. Navigate to <JBOSS_HOME>/configuration.
    2. Open
      standalone-full-ha.xml
      for editing.
    3. Include the following properties in the messaging section to improve cluster communication. These properties should have values that reflect an understanding of your network infrastructure, and for details on each property refer to the JBoss/Wildfly documentation.
      <cluster-connections> <check-period>1000</check-period> <connection-ttl>5000</connection-ttl> <call-timeout>5000</call-timeout> <confirmation-window-size>32000</confirmation-window-size> </cluster-connections>
      In the <jms-connection-factories> section, add the following properties in the <pooled-connection-factory name="hornetq-ra"> subsection.
      <ha>true</ha> <client-failure-check-period>3000</client-failure-check-period> <connection-ttl>6000</connection-ttl> <call-timeout>600000</call-timeout> <reconnect-attempts>-1</reconnect-attempts> <confirmation-window-size>1048576</confirmation-window-size> <failover-on-server-shutdown>true</failover-on-server-shutdown>
  3. Increase the JMS maxSessions parameters by editing the following files with these suggested values:
    • In standalone-full-ha.xml, change max-pool-size to 300. Note that this is a server-wide setting. The size of the combined individual message bean maxSession values should not exceed this setting.
    • In ejb-jar.xml, for each MessageBean, you must add an activation-config element, and change maxSession to 100.
    • In jboss-ejb3.xml, for each MessageBean, you must add an activation-config element, and change maxSession to 100.
    Follow these steps:
    A. Open the following file:
    [Wildfly home]\standalone\configuration\standalone-full-ha.xml
    B. Edit the file to change max-pool-size to 300:
    <subsystem xmlns="urn:jboss:domain:ejb3:2.0"> .... <pools> <bean-instance-pools> <!-- A sample strict max pool configuration --> <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/> <!-- Broadcom recommended max pool size increased from 20 - 300 --> <!-- This is a server wide setting. The combined individual msg queue maxSession values should not exceed this setting. --> <strict-max-pool name="mdb-strict-max-pool" max-pool-size="300" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/> </bean-instance-pools> </pools> .... </subsystem>
    C. Open the following file:
    [Wildfly home]\stanadlone\deployments\iam_im.ear\iam_im_idenityminder_ejb.jar\Meta-INF\ejb-jar.xml
    D. For each of the three MessageBean configurations used by
    Identity Manager
    , add the following activation-config element, and define the maxSession property with the values shown:
    <enterprise-beans> <message-driven id="MessageBean_1"> <ejb-name>SubscriberMessageEJB</ejb-name> <ejb-class>com.netegrity.ejb.message.subscriber.SubscriberMessageBean</ejb-class> <transaction-type>Bean</transaction-type> <env-entry id="EnvEntry_1"> <description/> <env-entry-name>nete-properties/jmslistener</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>com.netegrity.ims.msg.queue</env-entry-value> </env-entry> <!-- Broadcom recommended activation config property - maxSession = 100 --> <activation-config> <activation-config-property> <activation-config-property-name>maxSession</activation-config-property-name> <activation-config-property-value>100</activation-config-property-value> </activation-config-property> </activation-config> </message-driven> <message-driven id="ServerCommands"> <ejb-name>ServerCommandsEJB</ejb-name> <ejb-class>com.netegrity.ejb.message.subscriber.ServerCommandMessageBean</ejb-class> <transaction-type>Container</transaction-type> <activation-config> <activation-config-property> <activation-config-property-name>messageSelector</activation-config-property-name> <activation-config-property-value>MessageFormat = '1.0'</activation-config-property-value> </activation-config-property> <!-- Broadcom recommended activation config property - maxSession = 100 --> <activation-config-property> <activation-config-property-name>maxSession</activation-config-property-name> <activation-config-property-value>100</activation-config-property-value> </activation-config-property> </activation-config> </message-driven> <message-driven id="RuntimeStatusDetail"> <ejb-name>RuntimeStatusDetailEJB</ejb-name> <ejb-class>com.netegrity.ims.statusDetail.RuntimeStatusDetailMessageBean</ejb-class> <transaction-type>Bean</transaction-type> <!-- Broadcom recommended activation config property - maxSession = 100 --> <activation-config> <activation-config-property> <activation-config-property-name>maxSession</activation-config-property-name> <activation-config-property-value>100</activation-config-property-value> </activation-config-property> </activation-config> </message-driven>
    E. Open the following file:
    [Wildfly home]\stanadlone\deployments\iam_im.ear\iam_im_idenityminder_ejb.jar\Meta-INF\jboss-ejb3.xml
    F. Add the following activation-config element, and define the maxSession property with the values shown:
    <message-driven> <ejb-name>SubscriberMessageEJB</ejb-name> <ejb-class>com.netegrity.ejb.message.subscriber.SubscriberMessageBean</ejb-class> <activation-config> <activation-config-property> <activation-config-property-name>destinationType</activation-config-property-name> <activation-config-property-value>javax.jms.Queue</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>destination</activation-config-property-name> <activation-config-property-value>queue/iam/im/jms/queue/com.netegrity.ims.msg.queue</activation-config-property-value> </activation-config-property> <!-- Broadcom recommended activation config property - maxSession = 100 --> <activation-config-property> <activation-config-property-name>maxSession</activation-config-property-name> <activation-config-property-value>100</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>clientFailureCheckPeriod</activation-config-property-name> <activation-config-property-value>600000</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>connectionTTL</activation-config-property-name> <activation-config-property-value>-1</activation-config-property-value> </activation-config-property> </activation-config> </message-driven> <message-driven> <ejb-name>ServerCommandsEJB</ejb-name> <activation-config> <activation-config-property> <activation-config-property-name>destinationType</activation-config-property-name> <activation-config-property-value>javax.jms.Topic</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>destination</activation-config-property-name> <activation-config-property-value>topic/iam/im/jms/topic/ServerCommandTopic</activation-config-property-value> </activation-config-property> <!-- Broadcom recommended activation config property - maxSession = 100 --> <activation-config-property> <activation-config-property-name>maxSession</activation-config-property-name> <activation-config-property-value>100</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>clientFailureCheckPeriod</activation-config-property-name> <activation-config-property-value>600000</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>connectionTTL</activation-config-property-name> <activation-config-property-value>-1</activation-config-property-value> </activation-config-property> </activation-config> </message-driven> <message-driven> <ejb-name>RuntimeStatusDetailEJB</ejb-name> <ejb-class>com.netegrity.ims.statusDetail.RuntimeStatusDetailMessageBean</ejb-class> <activation-config> <activation-config-property> <activation-config-property-name>destinationType</activation-config-property-name> <activation-config-property-value>javax.jms.Queue</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>destination</activation-config-property-name> <activation-config-property-value>queue/iam/im/jms/queue/RuntimeStatusDetailQueue</activation-config-property-value> </activation-config-property> <!-- Broadcom recommended activation config property - maxSession = 100 --> <activation-config-property> <activation-config-property-name>maxSession</activation-config-property-name> <activation-config-property-value>100</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>clientFailureCheckPeriod</activation-config-property-name> <activation-config-property-value>600000</activation-config-property-value> </activation-config-property> <activation-config-property> <activation-config-property-name>connectionTTL</activation-config-property-name> <activation-config-property-value>-1</activation-config-property-value> </activation-config-property> </activation-config> </message-driven>
Fine Tuning Garbage Collection
You can adapt and tune the garbage collection for your application performance needs by entering the following options with changed settings on the JVM command line:
-Xms8g -Xmx8g -XX:+UseG1GC -XX:ConcGCThreads=12 -XX:ParallelGCThreads=22 -XX:MaxGCPauseMillis=1000 -XX:InitiatingHeapOccupancyPercent=40 -XX:G1HeapWastePercent=2 -XX:G1ReservePercent=15 -XX:+UnlockExperimentalVMOptions -XX:G1OldCSetRegionThresholdPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1NewSizePercent=20 -XX:G1MaxNewSizePercent=25
  • -XX:ConcGCThreads=12
    Sets the number of parallel marking threads. Sets n to approximately 1/4 of the number of parallel garbage collection threads (ParallelGCThreads).
  • -XX:ParallelGCThreads=22
    Sets the value of the STW worker threads. Sets the value of n to the number of logical processors. The value of n is the same as the number of logical processors up to a value of 8.
  • -XX:MaxGCPauseMillis=1000
    Sets a target value for desired maximum pause time. The default value is 200 milliseconds. The specified value does not adapt to your heap size.
  • -XX:InitiatingHeapOccupancyPercent=40
    Sets the Java heap occupancy threshold that triggers a marking cycle. The default occupancy is 45 percent of the entire Java heap.
  • -XX:G1HeapWastePercent=2
    Sets the percentage of heap that you are willing to waste. The Java HotSpot VM does not initiate the mixed garbage collection cycle when the reclaimable percentage is less than the heap waste percentage. The default is 10 percent.
  • -XX:G1ReservePercent=15
    Sets the percentage of reserve memory to keep free so as to reduce the risk of to-space overflows. The default is 10 percent. When you increase or decrease the percentage, make sure to adjust the total Java heap by the same amount.
  • -XX:G1OldCSetRegionThresholdPercent=15
    Sets an upper limit on the number of old regions to be collected during a mixed garbage collection cycle. The default is 10 percent of the Java heap.
  • -XX:G1MixedGCLiveThresholdPercent=90
    Sets the occupancy threshold for an old region to be included in a mixed garbage collection cycle. The default occupancy is 65 percent.
  • -XX:G1NewSizePercent=2
    Sets the percentage of the heap to use as the minimum for the young generation size. The default value is 5 percent of your Java heap. This is an experimental flag.
  • -XX:G1MaxNewSizePercent=25
    Sets the percentage of the heap size to use as the maximum for young generation size. The default value is 60 percent of your Java heap. This is an experimental flag.