# Large images timeout when image effects are applied to them, can cause CPU spike

#### Still need help?

The Atlassian Community is here for you.

Platform Notice: Server and Data Center Only. This article only applies to Atlassian products on the server and data center platforms.

## Problem

If a large image is added to a Confluence page, and then an image effect is attempted (such as drop shadow), the transformation can timeout.  While it's running, it can also cause CPU spikes and take down Confluence in certain situations.

Confluence will display:

The following appears in the atlassian-confluence.log

WARN [http-nio-8443-exec-17] [confluence.image.effects.ImageFilterServlet] transformAndRespond Timed out while doing the transform
java.util.concurrent.TimeoutException
at com.atlassian.confluence.image.effects.ImageFilterServlet.transformAndRespond(ImageFilterServlet.java:273)
at com.atlassian.confluence.image.effects.ImageFilterServlet.writeTransformToResponse(ImageFilterServlet.java:188)
at com.atlassian.confluence.image.effects.ImageFilterServlet.doGetInTransaction(ImageFilterServlet.java:155)
at com.atlassian.confluence.image.effects.ImageFilterServlet.lambda$doGet$0(ImageFilterServlet.java:132)

There is a bug filed for this:  CONFSERVER-55200 - Getting issue details... STATUS

## Cause

Confluence will attempt to apply effects to any image that is under 16MB in size.  It will wait for 12 seconds for the transformation to complete, at which point it will time it out.  This process is very CPU intensive, so the more resources your server has, the less chance it will run into this problem, unless your server is already very busy.  In busy servers, this additional CPU usage can have a destabilising impact.

## Workaround

You can add a JVM parameter that specifies the maximum file size that should be allowed to have an image effect applied to it.  The below parameter will set a max size of 1MB.  The default is 16MB.

-Datlassian.image_filter.transform.max_data_size=1000000