Table JOURNALENTRY is very large causing slowness in Confluence Data Center

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The JOURNALENTRY table keeps growing or it is quite big (~1 million entries), but the Clean Journal Entries is not removing those items and there are only few thousands removed on each execution. 

Diagnosis

You can use the following SQL statement to check how many records are removed on each execution: 

SELECT * FROM scheduler_run_details where job_id LIKE '%JournalCleaner%' order by start_time desc;

And compare it with the actual number of items in the JOURNALENTRY: 

SELECT COUNT(*) FROM JOURNALENTRY;

There is a job called Clean Journal Entries which periodically clears journal entries that have already been processed to ensure that its size does not grow indefinitely

Cause

The JOURNALENTRY table tracks all content changes that needs to be indexed and every Confluence node keeps a journal file under <confluence_home>/journal  that store a number that corresponds to the last item that was indexed on the node from the JOURNALENTRY table. There is a job called Clean Journal Entries which periodically clears journal entries that have already been processed to ensure that its size does not grow indefinitely. 

By default entries older than two days are removed, but the life time of entries can be overriden with com.atlassian.confluence.journal.timeToLiveInMillis  system property.

Solution

TRUNCATE the content of the JOURNALENTRY table and rebuild your index from scratch as outlined in KB How to manually rebuild content index from scratch on Confluence Data Center without any downtime

Monitor the JOURNALENTRY table and if keeps growing along the days, you can adjust the com.atlassian.confluence.journal.timeToLiveInMillis system property to a more restrictive value: 

  1. For example, if you want to reduce this life time to one single day, set this System Properties in your setenv.sh file as follows:

    CATALINA_OPTS="-Dcom.atlassian.confluence.journal.timeToLiveInMillis=86400000 ${CATALINA_OPTS}"
  2. Restart Confluence.


Last modified on Sep 18, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.