Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-29266

Image effects can consume all threads/memory

    XMLWordPrintable

Details

    Description

      Last two EAC outages were due to image processing (specifically applying gaussian blur). 21 http threads out of 40 were doing gaussian blur on some image(s), and also consuming all the free heap.

      We should:

      1. Have a queue for image processing
      2. Prevent multiple thread from processing the same image at the same time
      3. Have every thread in the queue have a timeout
      4. If the gaussian blur we're applying is always the same (image shadows), we should do one of two things:
        1. Store and display the shadow as a 9 grid (check the image in https://code.google.com/p/scale9grid/) and use that, either when processing the image on the background, or maybe even when displaying on the client itself, although that will be more difficult to do.
        2. If shadows are not always rectangles, we can use box blurring instead of gaussian. Its faster to process and uses less memory.
      5. Also, we can process only the border we need to process the image, instead of the whole image size.

      Workaround

      • Starting from version 5.8.x (comes with Image Effect plugin of version 1.3.1) you could set next system properties for controlling internal thread pool for image effect renderring:
        atlassian.image_filter.thread_pool_configuration.core_pool_size

        (defaults to 4)

        atlassian.image_filter.thread_pool_configuration.max_pool_size

        (defaults to 4)

      If you are running small instances (2cpus) then recommended values would be `1`since image effect is cpu heavy and you need to have some horsepower to the rest of the confluence.

      • Starting from version 6.0 there is additional fix which will prevent double processing of images which were are already getting processed (use case: impatient user refreshes page before it finishes load).

      Attachments

        1. Image-Effect-Dialog.png
          Image-Effect-Dialog.png
          127 kB
        2. Tree_Images.zip
          1.46 MB

        Issue Links

          Activity

            People

              psemeniuk Petro Semeniuk (Inactive)
              egarcia Angel Eduardo Garcia Hernandez (Inactive)
              Votes:
              7 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: