Performance Tuning

There are a number of new options available to help you tune Tapestry's internal configuration to better suite you particular applications scaling requirements. This section will go over what these options are and how to use them.

Page Pooling

The internal pooling of Tapestry pages now delegates the majority of actual pooling work to the commons-pool library. This means that your Tapestry application can now actually release idle pages from memory when they are no longer needed and hopefully increase the reliability/resources used of your production applications. All of the key configuration options are available in the HiveMind hivemind.FactoryDefaults configuration point which means that you can control these options via your servlet context parameters/.application file/hivemind/jvm system properties. The current options available are:

<contribution configuration-id="hivemind.FactoryDefaults">
    <default symbol="" value="1" />
    <default symbol="" value="-1" />
    <default symbol="" value="-1" />
    <default symbol="" value="4" />
    <default symbol="" value="40" />

This configuration is based around using the GenericKeyedObjectPool implementation in particular. The key used to store each Tapestry page is a combination of the pageName and Locale of the page. The meaning and use of each value is as follows:

  • - The minimum number of page instances that must not be evicted for a given key. The default value of 1 means that we want at least one instance of each unique page to be available at any given time.
  • - The maximum number of total pages that may be active in the pool. The default value of -1 indicates an unlimited number.
  • - The maximum number of idle pages that can exist in the pool. The -1 value here also means unlimited. (but doesn't mean they won't be evicted)
  • - This pool launches a seperate thread which is responsible for managing and evicted expired pages from the pool when appropriate. This value controls the number of minutes this thread should sleep before checking for expired pages.
  • - The number of minutes that a page must be idle for before being eligable for eviction from the pool.