Menu Top
Menu Bottom

Java Tunning

From: http://www.datadisk.co.uk/html_docs/java_app/jboss5/jboss5_tuning.htm

  1. Set up a test bed
  2. Do performance testing to obtain a baseline
  3. Investigate bottlenecks within the system these include network, hardware, database, etc
  4. Identify areas where improvements are needed which may or may not include changes to your web app
  5. Make one fix
  6. Repeat steps 2 through 5

The two areas that a user is concerned about are

  1. Response Time - From a users point of view performance is the time it takes to click a page to the time it is displayed (loaded into the browser), how long does it take when you click the button for the page to be returned and displayed.
  2. Throughput - Throughput is the number of transactions that can occur in a given amount of time, it is normally measured in transaction per second (tps).

Use SLA to set goals before tunning

  1. How long should a web transaction take?
  2. How long should a user wait before a page loads?
  3. How many users should the Web site support?
  4. What kind of traffic with will be expecting (bursty or constant)

Hardware Tuning

JVM Tuning

There are 2: server and client

The JVM allocates Java objects in an area of memory called the Java heap

There is a recommendation that you should set the min and max size of the heap to the same, the reason behind this is that if the values are different the JVM takes away time from processing the application to determine if it should adjust the sizes after garbage collection, this also applies to the young generation sizes, also it is recommended that the young generation size should be one-third to one-quarter the size of the heap.

There are two categories of garbage collection

  • Minor - cleans out the young generation only
  • Major - otherwise know as a full collection cleans out the tenured and young generations

Before a minor collection the JVM looks at the tenured generation and determines if there's ample space to hold any objects from the young generation that overflow into the tenured generation, if not, then it performs a collection on the tenured generation first, this is known as a full collection, the tenured generation is also compacted moving all the objects to one end of the tenured generation space.

There are two collector types

  • Serial - pauses the Java application until the collection has finished
  • Concurrent - performs most of the collection while the Java application continues to run, only two shorts phases causes the application to pause

Powered By Source H Last Modified: 04.29.17