Confluence 2.9 : Performance Tuning
This page last changed on Aug 04, 2008 by jlargman.
Like any server application, Confluence may require some tuning as it is put under heavier use. We do our best to make sure Confluence performs well under a wide variety of circumstances, but there's no single configuration that is best for everyone's environment and usage patterns. If you are having problems with the performance of Confluence and need our help resolving them, you should read this document: Requesting Performance Support Antivirus SoftwareAntivirus software greatly decreases the performance of Confluence. Antivirus software that intercepts access to the hard disk is particularly detrimental, and may even cause errors with Confluence. You should configure your antivirus software to ignore the Confluence home directory, its index directory and any database-related directories. Access logsYou can find out which pages are slow and which users are accessing them by enabling Confluence's built-in access logging. Built-in ProfilerYou can identify the cause of page delays using Confluence's built-in profiler according to Troubleshooting Slow Performance Using Page Request Profiling. Enabling HTTP CompressionIf bandwidth is responsible for bottlenecking in your Confluence installation, you should consider enabling HTTP compression. This may also be useful when running an external facing instance to reduce your bandwidth costs. Choice of DatabaseThe embedded database that is provided with Confluence is meant only to be used for evaluation, or for low-volume Confluence sites. Once your site grows, you will almost certainly need to switch to an external relational database management system. Beyond this, we do not recommend any particular RDBMS over another. We recommend using what you are familiar with, because your ability to maintain the database will probably make far more difference to what you get out of it than the choice of database itself. Database IndexesIf Confluence is running slowly, the most likely cause is that there is some kind of bottleneck in the database. If you have the luxury of access to a DBA, it would be worthwhile having them tune the database specifically to the demands that your particular Confluence installation is placing on it. If you do not have a DBA, you may want to consult the database indexing advice that we have been gathering from customer reports and our own experience running and developing Confluence. The instructions on that page are for Oracle, but most of the indexes can be applied to (and will help with) any database. (These database indexes are now created automatically when Confluence is installed, but existing installations upgrading to a more recent version may still need to add them manually) Cache TuningTo reduce the load on the database, and speed up many operations, Confluence keeps its own cache of data. Tuning the size of this cache may speed up Confluence (if the caches are too small), or reduce memory (if the caches are too big). Future versions of Confluence will allow you to tune the size of this cache from within the web application. In Confluence 2.3 to 2.5, the cache is configured in confluence/WEB-INF/classes/confluence-coherence-cache-config.xml (or confluence/WEB-INF/classes/confluence-coherence-cache-config-clustered.xml for clustered versions). In Confluence 2.6, these files can be found in confluence/WEB-INF/lib/confluence-2.6.0.jar. There is also a Cache Statistics page provided with Confluence. This page shows the size of each cache and its hit ratio. Important Caches
The following are more specific performance problems that can be resolved from tuning the cache. LDAP cache sizes and expiry does not appear to be picked up.This is a known problem, please refer to CONF-11858 for the solution. "Edit Page" screen takes a long time to loadIf your installation of Confluence is suffering from this problem, it may be due to a insufficient SpacePermissions cache size. To address this problem, first determine the number of space permission objects in your Confluence instance. You can do this by running this query against your database: > select count(*) from SPACEPERMISSIONS Now locate the cache entry for SpacePermissions in your ehcache.xml file. It looks like this: <cache name="com.atlassian.confluence.security.SpacePermission" maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="0" overflowToDisk="false" /> The equivalent for confluence-coherence-cache-config.xml would be: <local-scheme>
<scheme-name>cache:com.atlassian.confluence.security.CachingSpacePermissionManager.permissions</scheme-name>
<scheme-ref>default</scheme-ref>
<high-units>10000</high-units>
<expiry-delay>0s</expiry-delay>
</local-scheme>
Adjust the maxElementsInMemory or high-units property to the number of space permissions you have (in the example above, I've used 10000). Also, just as important, you need to adjust the timeToLiveSeconds or expiry-delay property to 0. Note: 10K of space permissions consumes approximately 8MB of memory. Please ensure there is enough memory allocated to your instance to cater for this. How to set specific cache settings
You can find more information about configuring the Coherence cache in the Coherence cache documentation. Default Cache Size and ExpiryIf a cache has not been defined, then it will use the default cache size and expiry. As the start of your confluence/WEB-INF/classes/confluence-coherence-cache-config.xml file you will notice the following: <cache-mapping> <cache-name>*</cache-name> <scheme-name>default</scheme-name> </cache-mapping> So basically all caches will default to using the default scheme, which is defined as below: <local-scheme> <scheme-name>default</scheme-name> <class-name>com.atlassian.confluence.cache.tangosol.ExpiryCountingLocalCache</class-name> <high-units>1000</high-units> <expiry-delay>3600</expiry-delay> </local-scheme> I.e. with a size of 1000 and an expiry of 3600 seconds. Other schemas use the above as their default and either override the size of the cache, or the length of the expiry. Adjust Application Server Memory SettingsSee Managing Application Server Memory Settings. Use A Web ServerFor high-load environments, performance can be improved by using a web server such as Apache in front of the application server. There is a configuration guide to Running Confluence behind Apache. When configuring your new web server, make sure you configure sufficient threads/processes to handle the load. This applies to both the web server and the application server connector, which are typically configured separately. If possible, you should enable connection pooling in your web server connections to the application server. Parallel GCIf you have a large of CPU's on your server you can add -XX:+UseParallelGC to your JAVA_OPTS options. This will allow garbage collection to happen in parallel with the application and can boost performance. For more information please refer to http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html#1.1.%20Types%20of%20Collectors%7Coutline. RELATED TOPICSPerformance Testing Scripts ![]() ![]() |
![]() |
Document generated by Confluence on Aug 07, 2008 19:05 |