Attachment dir growing out of control
Asked by Seth Floyd:

Has anyone seen your attachment directory grow out of control? I have maybe about 25 MB worth of attachments but my attachment folder has grown to over 4.5 GB all of the sudden in the last few days. I cant seem to track down whats causing this. Any ideas of where to start looking?

Its the "nonspaced" directory and sub dirs under it that are experiencing the size increase. Not sure if that makes a difference. Also the attachments are stored on the diskspace and not in the seperate db.

EDIT:

This is the dir that is growing...

atlassian/application-data/confluence/attachments/ver003/nonspaced

Does that ver003 stand out for any reason? We are running Confluence4.1.4 and getting ready to upgrade to 4.2.11.


Answers:
author: Jobin Kuruvilla [Adaptavist]
body: Look at the folder where the size suddenly increased. Using folder structure, you should be able to track down the pages where the big attachments are stored.

<https://confluence.atlassian.com/display/DOC/Hierarchical+File+System+Attachment+Storage>

comments: author: Thomas Schlegel
body: are there a lot of new attachments since the last days ? where are they stored ?


author: Seth Floyd
body: right....but my largest attachment is 1.1mb. Something is making the attachment folder itself "bloom" and grow.


author: Thomas Schlegel
body: @Jobin: this is about confluence, not Jira. I think there are no issues and no projects ;-) But of course there can be a process or plugin gone wild also.


author: Jobin Kuruvilla [Adaptavist]
body: It maynot be a single attachment. It can be some robot process adding 100 attachments on every issue in a project!


author: Jobin Kuruvilla [Adaptavist]
body: Aargh. Thanks Thomas! I updated the answer.

Again, you can find the pages using folder structure.


author: Seth Floyd
body: That folder structure diagram makes no sense to me.

I entered a support ticket and they suggested i wipe out the plugin cache folders. I did this and restarted Confluence and theat night when my backup ran it was about 2 Gb smaller...but its still about double what it should be.

**Clearing Plugin Cache**

*To clear the plugin caches:*

* *Shutdown Confluence - ensure the process is stopped.*
* *Delete the following directories in the confluence.home folder:*
  * *\<confluence-home\>/bundled-plugins*
  * *\<confluence-home\>/plugin-cache*
  * *\<confluence-home\>/plugins-osgi-cache*
  * *\<confluence-home\>/plugins-temp*
* *Restart Confluence*   
  *The plugin caches will be rebuilt on startup.*

Im wondering if there is some page diff issues that are storing all the diffs and making this grow more and more.

ill update more when I figure this out.


author: Andrew Cooper
body: I have the same problem running Confluence v4.2.13. I've also noticed that the large number of attachmentsin the nonspaced folder seem to be associated with a large number of Drafts being created anonymously.

Looking in the database the Content table has about 4700 rows, nearly 1500 of which have the CONTENTTYPE = 'DRAFT' and the CREATOR is null. The DRAFTSPACEKEY varies, and the DRAFTTYPE is always 'page'. Looking at the LASTMODDATE column there are periods over the last few weeks where there are over 30 of these being created in an hour, and it happens at various time of the day.

What could be causing this?

The only non-builtin plugins we have installed are the Adaptavist Content Formatting Macros plugin, and its associated licensing plugin, and two plugins we developed in-house which just provide a theme and a couple of macros.


author: Seth Floyd
body: might have narrowed this down to the Team Calendar plugin. I was also getting a huge hit in performance so I started backtracking what had been installed recently and I disabled the calendar plugin and so far my performance has improved drastically. Doesnt resolve the huge attachment issue but i still think they are related.


author: Seth Floyd
body: So from what I have gathered the "nonspaced" dir is where attachments that have no spaces go. I have no attachments that are in no spaces. What happens if i del this dir? This is where the 4.5 gb is sitting.


Tags: attachment

directory