あらゆるサーバーアプリケーションと同様に、Confluence は頻繁に利用されるため、何らかのチューニングが必要になる場合があります。弊社では、Confluence が多種多様な環境下で十分なパフォーマンスを実現できるように最善を尽くしていますが、あらゆる人の環境や利用パターンに最適な単一の設定は存在しません。

If you are having problems with the performance of Confluence and need our help resolving them, you should read this document: Requesting Performance Support

アクセス ログ

You can find out which pages are slow and which users are accessing them by enabling Confluence's built-in access logging.

Built-in Profiler

You can identify the cause of page delays using Confluence's built-in profiler according to Troubleshooting Slow Performance Using Page Request Profiling.

Choice of Database

The 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.

Antivirus Software

Antivirus Software can greatly decrease the performance of Confluence. Antivirus Software that intercepts all access to the hard disk is particularly detrimental, and may even cause errors with Confluence. If possible configure your software to ignore the Confluence home directory, or at least its index directory.

データベース インデックス

If 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 Tuning

To 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

  • com.atlassian.confluence.core.ContentEntityObject should be set to at least 20-30% of the number of content entity objects (pages, comments, emails, news items) in your system. To find the number of content entity objects, use the query select count(star) from CONTENT.
  • com.atlassian.confluence.core.ContentEntityObject.bodyContents should be set to at least 20% of the number of content entity objects (pages, comments, emails, news items) in your system. To find the number of content entity objects, use the query select count(star) from CONTENT.
  • com.atlassian.confluence.security.PermissionCheckDispatcher.isPermitted() should be set to at least the number of concurrent users you expect to access Confluence at the same time
  • com.atlassian.confluence.user.DefaultUserAccessor.deactivatedUsers must be set to at least the number of users with USE_CONFLUENCE permission (don't worry, it only takes up a few bytes per user). To find an upper bound for this, use the query select count(star) from OS_USER, or if you have configured atlassian-user.xml to use the Hibernate repository, select count(star) from users.
  • com.atlassian.confluence.security.SpacePermission should be set to the number of space permissions in your deployment (a good rule of thumb is 20 times the number of spaces). You can find the number of space permissions using the query select count(star) from SPACEPERMISSIONS.

The following are more specific performance problems that can be resolved from tuning the cache.

"Edit Page" screen takes a long time to load

If you're 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

  1. From the file confluence/WEB-INF/classes/com/atlassian/confluence/admin/actions/cache-name-mappings.properties, find the cache name.
  2. Find the appropriate <cache-mapping> tag in confluence-coherence-cache-config.xml or confluence-coherence-cache-config-clustered.xml. If the tag doesn't exist, you can create it within the <caching-scheme-mapping> tag.
  3. The <scheme-name> will correspond to a <local-scheme> tag below. It refers to a scheme reference. Either change the high-units tag in the scheme reference, or add a high-units tag to override the scheme reference. For example, the following tag would change the Content Bodies cache from the default 1000 units to 2000 units:
    <local-scheme>
    <scheme-name>cache:com.atlassian.confluence.core.ContentEntityObject.bodyContents</scheme-name>
    <high-units>2000</high-units>
    <scheme-ref>default</scheme-ref>
    <expiry-delay>0s</expiry-delay>
    </local-scheme>
    

You can find more information about configuring the Coherence cache in the Coherence cache documentation.

Adjust Application Server Memory Settings

See Managing Application Server Memory Settings.

Use A Web Server

For 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.

新しい web サーバーを設定する場合、負荷を処理するのに十分なスレッド/プロセスを設定するようにしてください。これは、web サーバーおよびアプリケーション サーバー コネクターの両方に適用されますが、通常は別々に設定されます。可能であれば、アプリケーション サーバーに対する web サーバー コネクション内のコネクション プーリングを有効にする必要があります。