Boost Anonymize User process

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 user anonymization process in JIRA Datacenter appears to be experiencing significant delays for large instances.

Environment

Jira Datacenter instances.

Cause

The extended time taken for anonymizing users in the production environment can be due to:

  1. Size of the System: Larger systems with more users and issues will take longer to anonymize due to the volume of data.

  2. User Activity: The more operations a user has performed, the longer the anonymization process will take.

  3. Blocking of User Updates: During the anonymization process, all other updates to the user are blocked, including updates from external user directories, which could extend the duration of the process.

Solution / Suggestions 

To mitigate this issue and speed up the anonymization process, consider the following strategies:

  1. Perform Anonymization During Off-Peak Hours: This strategy reduces the load on your system and minimizes conflicts with other user updates.

  2. Anonymize Users in Batches: To avoid overloading the system, consider anonymizing users in smaller batches rather than all at once.

  3. Increase System Resources: Allocating more CPU, memory, or disk I/O resources to your JIRA instance and database server can improve performance.

  4. Optimize Database Performance: Reviewing and improving your database server's configuration can enhance overall performance.

  5. Disable Unnecessary Plugins: Temporarily disabling any unnecessary plugins can reduce the system load during the anonymization process.

  6. Regular Maintenance: Regular maintenance activities such as cleaning up old data, re-indexing databases, and updating software and hardware systems can help maintain optimal server performance.

If these steps don't improve the performance of the anonymization process, consider reaching out to Atlassian's customer support. Complex issues might involve detailed log analysis and advanced troubleshooting.

Additionally, you can also run below SQL query on the database to understand how long does the execution takes without involvement of any of the Jira features. The below anonymization SQL query is running joins against three tables, and on a large instance the process gets very expensive and execution time spikes. Best practices around it is covered as part of bug ticket - https://jira.atlassian.com/browse/JRASERVER-71251

Always back up your data before performing any modification to the database. If possible, try your modifications on a test server.

select count(distinct ISSUE.id)
from jiraissue ISSUE
left join customfieldvalue CUSTOM_FIELD_VALUE
on ISSUE.id = CUSTOM_FIELD_VALUE.issue
left join customfield CUSTOM_FIELD
on CUSTOM_FIELD.id = CUSTOM_FIELD_VALUE.customfield
where ISSUE.environment like '%[~<username>]%' or ISSUE.description like '%[~<username>]%' or CUSTOM_FIELD.customfieldtypekey 
in ('com.atlassian.jira.plugin.system.customfieldtypes:textfield', 'com.atlassian.jira.plugin.system.customfieldtypes:textarea') and 
(CUSTOM_FIELD_VALUE.stringvalue like '%[~<username>]%' or CUSTOM_FIELD_VALUE.textvalue like '%[~<username>]%')

The above query is tested on Mysql database and depending around your database might need additional tweaking. Replace actual usernames in the above query.


Notes:

This is a general guideline and the exact steps might vary depending on your server environment and specific JIRA configuration. Always make sure to back up your data before making any significant changes.



Last modified on Mar 6, 2025

Was this helpful?

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