Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-78911

Slow issue JSON generation (webhooks/REST API) in Jira Data Center when custom fields are overly scoped

XMLWordPrintable

    • 9.12
    • 9
    • Severity 2 - Major
    • 44
    • Hide
      Atlassian Update – 10 October 2025

      Hi everyone,

      Thank you for your continued feedback and engagement on this issue.

      Following the optimizations shipped in recent Jira Data Center releases, our team is actively working on a further change to how issue fields are serialized. This upcoming improvement is designed to fully address the root cause of this bug and deliver more consistent performance for webhook and REST API payloads.

      In addition to these targeted fixes, we have taken a broader look at webhook payload serialization performance. As a result, we have identified and prioritized four key problem areas that impact scalability and efficiency. We encourage you to watch and vote for the following related issues to help us prioritize our work:

      We appreciate your patience as we continue to improve Jira Data Center’s performance and scalability. Please continue to watch this ticket for future updates.

      Best regards,
      Daniel Rauf
      Jira Data Center Team

      Show
      Atlassian Update – 10 October 2025 Hi everyone, Thank you for your continued feedback and engagement on this issue. Following the optimizations shipped in recent Jira Data Center releases, our team is actively working on a further change to how issue fields are serialized. This upcoming improvement is designed to fully address the root cause of this bug and deliver more consistent performance for webhook and REST API payloads. In addition to these targeted fixes, we have taken a broader look at webhook payload serialization performance. As a result, we have identified and prioritized four key problem areas that impact scalability and efficiency. We encourage you to watch and vote for the following related issues to help us prioritize our work: JRASERVER-79124 – Inefficient database queries in changelog serialization JRASERVER-79125 – No limits for changelog serialization JRASERVER-79126 – Comment serialization not using caches JRASERVER-79127 – Expensive permission checks in comment serialization We appreciate your patience as we continue to improve Jira Data Center’s performance and scalability. Please continue to watch this ticket for future updates. Best regards, Daniel Rauf Jira Data Center Team

      Issue Summary

      Issue JSON generation is decelerated when custom field contexts are excessively scoped to specific projects. This component is used both in the REST API and issue-related webhooks for synchronous and asynchronous payload generation.

      During generation, the JSON serializer needs to determine which navigable fields the requesting user can view, based on custom field contexts and project permissions. This process iterates through all unhidden navigable fields, evaluating the contexts and each project specified within the context scheme.

      Stack trace

      Single-node DC
      com.atlassian.cache.memory.DelegatingCachedReference.get(DelegatingCachedReference.java:76)
      com.atlassian.cache.impl.metrics.InstrumentedCachedReference.get(InstrumentedCachedReference.java:58)
      com.atlassian.jira.cache.stats.CachedReferenceWithStats.get(CachedReferenceWithStats.java:24)
      com.atlassian.jira.project.CachingProjectManager.getProjectObj(CachingProjectManager.java:80)
      com.atlassian.jira.issue.context.ProjectContext.getProjectObject(ProjectContext.java:74)
      com.atlassian.jira.issue.fields.config.FieldConfigSchemeImpl.isAllProjects(FieldConfigSchemeImpl.java:177)
      [...]
      com.atlassian.jira.issue.fields.ImmutableCustomField.isAllProjects(ImmutableCustomField.java:1303)
      com.atlassian.jira.issue.fields.DefaultFieldManager.userHasPermissionToCustomFieldProjects(DefaultFieldManager.java:282)
      com.atlassian.jira.issue.fields.DefaultFieldManager.getAvailableNavigableFields(DefaultFieldManager.java:264)
      [...]
      com.atlassian.jira.rest.v2.issue.IssueBeanBuilder2.createFieldsDataFromNavigable(IssueBeanBuilder2.java:277)
      com.atlassian.jira.rest.v2.issue.IssueBeanBuilder2.createFieldsData(IssueBeanBuilder2.java:208)
      com.atlassian.jira.rest.v2.issue.IssueBeanBuilder2.build(IssueBeanBuilder2.java:145)
      com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.build(IssueBeanBuilder.java:63)
      com.atlassian.jira.plugins.webhooks.serializer.issue.IssueBeanFactory.createBean(IssueBeanFactory.java:37)
      
      Clustered
      com.atlassian.cache.ehcache.DelegatingCachedReference.get(DelegatingCachedReference.java:71)
      com.atlassian.cache.impl.metrics.InstrumentedCachedReference.get(InstrumentedCachedReference.java:58)
      com.atlassian.jira.cache.stats.CachedReferenceWithStats.get(CachedReferenceWithStats.java:24)
      com.atlassian.jira.project.CachingProjectManager.getProjectObj(CachingProjectManager.java:80)
      [...]
      

      Steps to Reproduce

      An XML site backup and reproduction script has been attached to this bug report. To use it:

      1. Install Jira 9.12.24 (backup version) and restore the XML backup. After restoring, upgrade to a later version, if needed.
      2. Configure 5+ webhooks (“issue updated” event, no JQL filter).
      3. Run the reproduction script (generates 5000 issue updates with 10 parallel threads). Adjust the URL/PAT and call with "node update-issues-parallel-batch.js".
      4. Capture thread dumps during execution.

      Backup Contents

      • 500 projects
      • 5000 issues (10/project)
      • 500 custom fields, each explicitly including all 500 projects in the context scheme

      Expected Results

      The HTTP or webhook publisher/executor threads (webhook-dispatcher) can efficiently serialize the issue.

      Actual Results

      High CPU usage with processing time growing exponentially:

      (project cache lookups) =
        (number of custom fields)
        x (number of contexts per custom field)
        x (number of projects in each context)
        [x (number of applicable webhooks)]
      
      = 1,250,000 = 500 x 1 x 500 x 5
      

      This causes delays in webhook payload generation/delivery and issue REST API response times.

      Jira 9.12 (sync webhooks)

      Using the test dataset, about 46% of the thread dump frames are accessing the project cache:

      HTTP threads processing webhooks

      HTTP threads processing webhooks -> accessing project cache

      Jira 10.3 (async webhooks)

      Using the test dataset, about 37% of the thread dump frames are accessing the project cache:

      In some customer environments, 95-100% of frames are accessing this cache.

      Workaround

      Workaround 1 (short term)

      Hide unnecessary fields from the field configuration (Specifying field behavior). This excludes the field before it reaches this expensive path.

      Note: excluding the current issue's project from the custom field's context (Configuring custom field contexts) doesn't alleviate the problem since the expensive path will still process all other projects in the context.

      Workaround 2 (long term)

      Decrease the overall number of custom fields. The product guardrail is 1,200 custom fields, and support recommends staying under 700 custom fields.

      Workaround 3 (webhooks only)

      Increase the webhook executor thread pool size (webhooks.executor.thread.count), as described in Tuning webhook performance parameters in Jira Data Center). This may result in higher CPU utilization.

      Similarly, consider reducing the webhook executor queue size (webhooks.executor.queue.size) and increasing the enqueue timeout (webhooks.executor.queue.wait.timeout.millis) to 10-30 seconds. This replicates some of the natural backpressure from synchronous webhooks, which may force users and integrations to wait longer for their edits/transitions to return.

      Note: These parameters are only available in Jira 10.3.5+ LTS and 10.6.0+ (not 10.4.x or 10.5.x). Please upgrade to 10.3.5+ or 10.6.0+.

        1. custom-field.png
          custom-field.png
          37 kB
        2. jira-10-3-webhook-publisher-threads.png
          jira-10-3-webhook-publisher-threads.png
          821 kB
        3. jira-9-12-project-cache.png
          jira-9-12-project-cache.png
          775 kB
        4. jira-9-12-webhook-processing.png
          jira-9-12-webhook-processing.png
          746 kB
        5. new_tested_patch_jira_9_12_2025-06-27T13_27_42.068Z.zip
          11 kB
        6. update-issues-parallel-batch.js
          2 kB
        7. xml-backup.zip
          3.00 MB

              drauf Daniel Rauf
              1353e2e9fd2f Benjamin S
              Votes:
              16 Vote for this issue
              Watchers:
              25 Start watching this issue

                Created:
                Updated: