Performance Tuning Servers

DISCLAIMER

The default settings for the AnthillPro server tend to work well for many customers. However, in extreme cases where either the server hardware has limitations, or the server activity and user base is large, these tuning options may help.

JVM Options

Adding these options to the setenv.sh file (3.8.3+), or modifying your ah3server launch script to include these arguments will improve the server's usage of available resources and UI responsiveness.

The following options deal with the heap size of the server java process as well as garbage collection performance. It is recommended that users perform their own analysis, using -XX:+PrintGCDetails, -XX:+PrintGCTimeStamps, -XX:+PrintHeapAtGC, -verbose:gc, & -Xloggc:gc.log flags as well as -Xms64m -Xmx3g (32 bit) or -Xmx6g (64 bit), to determine what heap sizes and ratios work best for them.

Heap

  • -Xms###
    • Sets the minimum heap size to "###". Generally for moderate systems this should be 768m. DO NOT FORGET SIZE DESCRIPTOR (k, m, g).
  • -Xmx###
    • Sets the maximum heap size to "###". Generally for moderate systems this should be 2g (32 bit) or 4g (64 bit). DO NOT FORGET SIZE DESCRIPTOR (k, m, g).
  • -XX:MaxHeapFreeRatio=##
    • Sets the maximum percentage of free heap space before the size is reduced but not lower than the Xms setting. This number should be between 35 and 100 and approximately 30 points higher than the minimum heap ratio. A good starting point for this value is 55.
  • -XX:MinHeapFreeRatio=##
    • Sets the minimum percentage of free heap space before the size is increased but not greater than the Xmx setting. This number should be between 5 and 75 and approximately 30 points lower than the maximum heap ratio. A good starting point for this value is 25.

Garbage Collection

  • -XX:+UseParallelOldGC
    • This setting allows garbage collection to use multiple threads in parallel and reduces process wait time. If running the server on a multi-core architecture this setting should be turned on.
  • -XX:ParallelGCThreads=#
    • Sets the number of threads the garbage collector can use in parallel. Generally this number should roughly correlate to the number of cores available in your system but not more than double.
  • -XX:+DisableExplicitGC
    • Disables the server from initiating garbage collection directly. This will ensure that the settings described above are honored and the system is not overwhelmed by unexpected garbage collection runs.

JVM (IBM) Options

Adding these options to the setenv.sh file (3.8.3+), or modifying your ah3server launch script to include these arguments will improve the server's usage of available resources and UI responsiveness.

The following options deal with the heap size of the server java process as well as garbage collection performance. It is recommended that users perform their own analysis, using the -verbose:gc & -Xverbosegclog<filename> flags as well as -Xms64m -Xmx3g (32 bit) or -Xmx6g (64 bit), to determine what heap sizes and ratios work best for them.

Heap

  • -Xms###
    • Sets the minimum heap size to "###". Generally for moderate systems this should be 768m. DO NOT FORGET SIZE DESCRIPTOR (k, m, g).
  • -Xmx###
    • Sets the maximum heap size to "###". Generally for moderate systems this should be 2g (32 bit) or 4g (64 bit). DO NOT FORGET SIZE DESCRIPTOR (k, m, g).
  • -Xmaxf##
    • Sets the maximum percentage of free heap space before the size is reduced but not lower than the Xms setting. This number should be between 0.35 and 1.0 and approximately 30 points higher than the minimum heap ratio. A good starting point for this value is 0.55.
  • -Xminf##
    • Sets the minimum percentage of free heap space before the size is increased but not greater than the Xmx setting. This number should be between 0.05 and 0.75 and approximately 30 points lower than the maximum heap ratio. A good starting point for this value is 0.25.

Garbage Collection

  • -Xgcthreads#
    • Sets the number of threads the garbage collector can use in parallel. Generally this number should roughly correlate to the number of cores available in your system but not more than double.
  • -Xdisableexplicitgc
    • Disables the server from initiating garbage collection directly. This will ensure that the settings described above are honored and the system is not overwhelmed by unexpected garbage collection runs.

Database Connections (base.xml)

You can modify the following properties in the base.xml file to change performance to the database:

  •     <property name="maxActive">
         <value>280</value>
        </property>
    
    • Increases Maximum Active Connections. Default is 20.
  •     <property name="maxIdle">
         <value>280</value>
        </property>
    
    • Increases Maximum Idle Connections. Default is 20.
  •     <property name="minIdle">
         <value>280</value>
        </property>
    
    • Increases Minimum Idle Connections. Default is 20.



NOTE: SETTING "maxActive", "maxIdle", AND "minIdle" VALUES TOO HIGH WITHOUT SETTING UP THE DATABASE PROPERLY TO HANDLE THE HIGHER NUMBER OF CONNECTIONS CAN AND WILL FLOOD THE DATABASE, THEREBY DECREASING PERFORMANCE (POSSIBLY TO A CRAWL). ALSO, THESE VALUES MAY BE OVERWROTE UPON UPGRADE!

Modify:

  <bean id="dataSource0" class="com.urbancode.anthill3.spring.DecryptPasswordDataSource"
        destroy-method="close">
    <property name="driverClassName">
      <value>${install.db.driver}</value>
    </property>
    <property name="url">
      <value>${install.db.url}</value>
    </property>
    <property name="username">
      <value>${install.db.user}</value>
    </property>
    <property name="password">
      <value>${install.db.password}</value>
    </property>
    <property name="maxActive">
     <value>280</value>
    </property>
    <property name="maxIdle">
     <value>280</value>
    </property>
    <property name="minIdle">
     <value>280</value>
    </property>
    <property name="defaultTransactionIsolation">
      <value>2</value>
    </property>
    <property name="testOnBorrow">
      <value>true</value>
    </property>
    <property name="validationQuery">
      <value>${install.db.validationQuery}</value>
    </property>
    <!-- not available in our version or the database connection pool library
    <property name="validationQueryTimeout">
      <value>10</value>
    </property>
    -->
    <!-- track abandoned connections. this adds a overhead. only enable if connections are being leaked.
    <property name="logAbandoned">
      <value>true</value>
    </property>
    <property name="removeAbandonedTimeout">
      <value>300</value>
    </property>
    <property name="removeAbandoned">
      <value>false</value>
    </property>
     -->
  </bean>

Linux Tunables For Increasing Threads & Sockets

These are Linux tunables for increasing the number of threads and sockets available to a process.

System PIDs

Limits the number of threads. The limit is system-wide and configured system-wide. The name implies this is a process limit, but Linux counts threads as processes.

  • Get current value
    • sysctl kernel.pid_max
  • Set temporarily
    • sysctl -w kernel.pid_max=NUMBER
  • Set permanently
    • modify /etc/sysctl.conf:
      • kernel.pid_max=NUMBER

System threads

Limits the number of threads. The limit is system-wide and configured system-wide.

  • Get current value
    • sysctl kernel.threads-max
  • Set temporarily
    • sysctl -w kernel.threads-max=NUMBER
  • Set permanently
    • modify /etc/sysctl.conf:
      • kernel.threads-max=NUMBER

Process memory mapping count

Limits the number of memory mapped areas. The limit is per process and configured system-wide.

Memory mappings are used for thread stacks. The default value may be sufficient even if other tunables required adjustment.

  • Get current value
    • sysctl vm.max_map_count
  • Set temporarily
    • sysctl -w vm.max_map_count=NUMBER
  • Set permanently
    • modify /etc/sysctl.conf:
      • vm.max_map_count=NUMBER

User processes

Limits the number of threads. The limit is per user and configured per user. The name implies this is a process limit, but Linux counts threads a processes.

  • Get current value
    • ulimit -u
  • Set permanently (requires new login to take effect)
    • modify /etc/security/limits.conf:
      • username soft nproc NUMBER
      • username hard nproc NUMBER

User open files

Limits the number of open files and sockets. The limit is per process and configured per user.

  • Get current value
    • ulimit -n
  • Set permanently (requires new login to take effect)
    • modify /etc/security/limits.conf:
      • username soft nofile NUMBER
      • username hard nofile NUMBER

DISCLAIMER

While every effort is made by the staff at IBM to ensure that accurate information is disseminated through this medium, IBM makes no representation about the content and suitability of this information for any purpose. The contents on this site are provided "as is" without express or implied warranty. In no event shall IBM be liable for any special indirect or consequential damages or any damages whatsoever resulting from loss of income or profits, whether in an action of contract, negligence or other tortious action, arising in connection with the use or performance of this information.

Further, IBM has provided "hypertext links" to a number of sites (both internal & external) as a service to our readers. This should NOT be taken as implying any link between us and those various organizations or individuals, nor can we be responsible for the content on their web site.

IBM reserves the right to alter, amend, or delete any contents without notice.

Any reproduction of information from this site in partial or full is strictly prohibited and will result in legal action unless you have prior written permission from the site owner!