Confluence 4.x Extremely Slooowwwww
Asked by Chris Schmidt:

We are evaluating Confluence as an option for our product support site - I have used confluence for quite a while for several development projects and think it is the perfect match for what we want. So we installed confluence 4.1 into a VM in our Data Center - instantly the CPU spiked to 200% on a Dual-Proc VM with 8g of RAM O_o

Response times render it completely unusable, up to 30 seconds to load a page sometimes! I read somewhere that this may be an affect running confluence within a VM - however, I have been running a 3.5 instance in a VM with less resources (1 Proc, 4g RAM) for a year with no slowness whatsoever.

Anyone had similar expereinces or have recommendations. For the interim I am installing 3.5 in hopes that it will run at least as fast as my other instance - but I really would like to run on the latest.


Answers:
author: Chris Schmidt
body: FYI - There is an obscure setting in ESXi that limits RAM to 512m (under resource allocation). The VMWare ESXi essentially tells the OS that it has however much memory you have allocated, but it appears to only be exposing a 512mb page which it then swaps internally - causing some serious performance issues. Disabling this completely resolved my issue.


author: Adam Saint-Prix
body: That sounds like it should be a Confluence/JIRA knowledgebase article.

<br />

"If you are running VMWare ESXi and having performance issues, check to make sure..."

comments: author: Chris Schmidt
body: +1 - That would have saved several hairs on my head and made my hair a little less grey at the end of this week. Hence why I came back to post the solution


author: Adam Saint-Prix
body: Totally get that and was glad to see you post the solution. Michael Seager or any other Atlassian folks: any chance you can make this into a KB per Chris' posted solution?


author: Michael S
body: Chris,

Is there something in particular that's causing the spike? Usual culprits are scheduled XML backups, exporting to XML or trying to view certain Office files (XLSX and PPT can cause problems).

Try disabling the Office Connector and any scheduled backups as a first step. If that doesn't help, try taking external thread dumps (kill -3 \<PID\>) every 30 seconds for about for a period of a few minutes while it's slow and then create a support request via [support.atlassian.com](http://support.atlassian.com) with those logs - we'll take a look into it.

Michael Seager  
Atlassian Support - Sydney

comments: author: Chris Schmidt
body: I had backups disabled, I didn't disable the Office Connector tho. I had the same issue with 2 different distro's of 4 (4.0/4.1) and a botched install with 3.5 - I am currently trying the WAR version of Confluence 4.1.5 rather than the standalone version (since I am also running a tomcat instance on the box for jForum - it is a more ideal deployment anyway) - If the problems continue with the WAR deployment in an otherwise stress tested Tomcat 7 I will follow through with a bunch of thread dumps and raise an issue. Thanks Michael


author: Jobin Kuruvilla [Adaptavist]
body: How much is the JAVA heap memory allocated to Confluence? You can find it under Administration \> System Info. Try increasing it if it is the default 512MB.

See http://confluence.atlassian.com/display/DOC/Memory+usage+and+requirements

comments: author: Chris Schmidt
body: Nope that was the first thing I tried - I have seen heap swapping cause similar problems. I tried increasing heap to 2g, increasing permgen to 512m, enabled parallel gc, enabled hotspot compiler (-server) - nothing seemed to really make it any better.


Tags: performance

virtual-machine