Tomcat 8 - Serving Static content extremely slow...

After upgrading my Confluence to newest (and hence Tomcat 8), serving some static content became extremely poor in performance.

I have the AllowLinking=true, so some js scripts and css resources could be fetched from the filesystem. No problem until Tomcat 8, where the time from the server went to:

Screen Shot 2015-09-17 at 17.58.03.jpg

Uploading the files to Confluence and making a link to /download/xxxxxxx/filename.js solved the issue, and the time for the 2 files is roughly around 64ms per file. This is an acceptable solution, as migrations and stuff gets a bit simpler, but still... why the extreme poor performance. No changes to OS og Filesystem or similar, just the upgrade.....

4 answers

1 vote
Chuck Talk Atlassian Team Sep 17, 2015

Hi Normann,

I am not sure of your network setup, but you can add the following to your Connector parameter within server.xml:

<Connector port="8575" connectionTimeout="20000" redirectPort="8443"
maxThreads="200" minSpareThreads="10" compression="on"
enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8" />

That should help with delivery of the static resources. In the alternative, you could use an Apache front-end to cache the static resources for delivery to end users as well.



Sounds interesting, and Apache has always been the frontend - but I dont want to "disconnect" resources to much from the Confluence Instance. I will look into the compression though....

I had to also add `useSendfile="false"` to the Connector element in order for the compression to work. 

Afterwards I have swiched from Apache2 to NGIX and killed a lot of old not used plugins to finetune.

Hi Normann,

If you upgraded Confluence out-of-the-box, it's more likely that you're with the default memory settings. Would you mind checking the following?

To increase the JVM memory, here are the steps:


# From <confluence-install>/bin (Stand-alone) or <Tomcat-home>/bin (EAR-WAR installation), open (you can create this file in the EAR/WAR version).
# Find the section JAVA_OPTS="-Xms256m -Xmx512m -XX:MaxPermSize=256m ...
# See Diagnosis above and enter the appropriate values. Xmx is maximum, Xms is minimum, and MaxPermSize is PermGen.


# From <confluence-install>/bin (Stand-alone) or <Tomcat-home>/bin (EAR-WAR installation), open setenv.bat.
# Find the section set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx512m -XX:MaxPermSize=256m
# See Diagnosis above and enter the appropriate values. Xmx is maximum, Xms is minimum, and MaxPermSize is PermGen.

Running Confluence as a Service:

* You can scroll down to Windows Service section:]

For more information, you can refer to this documentation: :How to Fix Out of Memory Errors by Increasing Available Memory:].


Current config (as before): -Djava.util.logging.config.file=/opt/confluence/conf/ -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -XX:-UseAESIntrinsics -Djava.awt.headless=true -Xloggc:/opt/confluence/logs/gc-2015-09-17_18-42-22.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M -XX:-PrintGCDetails -XX:+PrintGCTimeStamps -XX:-PrintTenuringDistribution -Xms2048m -Xmx2048m -XX:MaxPermSize=1024m -XX:+UseG1GC -Djava.endorsed.dirs=/opt/confluence/endorsed -Dcatalina.base=/opt/confluence -Dcatalina.home=/opt/confluence I always (after upgrade) - need to change settings in - And I can for sure set it higher, but this is a small website for my personal use only .... But thanx for the answer :-)

We've experienced similar issues with custom and even Confluence supplied JS files: In our case, it looks like only JS files are affected by this issue.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

1,018 views 51 8
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you