confluence disk space usage for a space

How to calculate how much disk space is used by a particular confluence space

3 answers

0 vote

Iterate through every page within the space, and ask your DBAs how much the rows comprising the content and history take up, then add the size of all the attachmnets.

0 vote

To find out the size of the attachments in confluence, you can check the space's directory size. According to the Hierarchical File System Attachments Storage documentation, you'll find them on the fourth level of directories, where ver003 is a the first one.

If you're using Linux or Mac, one way to find it is to find out the space's ID in the database and the do:

cd <attachments directory>/ver003
find . -name <space ID>

Once you find the directory, go to it (cd again) and run:

du -sh .

 

If you're using Windows, you can use other tools for searching and checking the size of directories.

I hope it was helpful.

Kind regards,
Jaime Kirch da Silveira
Atlassian Cloud Support

How about below macro:

Credit goes to (Developed by) Matthew Horn

 

## Macro title: Space Meta Data 2
## Macro has a body: Y or N (N)
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: Matthew Horn, based on Space Meta Data by Andrew Frayling
## Date created: 06/07/2012
## Installed by: <your name>
## Macro to display information such as number of pages, number of blog posts, attachment size, etc. about a named Space.
## @param TargetSpace:title=Target space|type=string|desc=Enter the KEY of the space you want metadata for. For example, coredoc, gscontent, samples, wncontent|required=true|multiple=false
## Get space details
#set ( $targetSpace = $spaceManager.getSpace($paramTargetSpace) )
#set ( $spaceName = $targetSpace.getName() )
#set ( $spaceKey = $targetSpace.getKey() )
#set ( $spaceHome = $targetSpace.getHomePage() )
#set ( $spaceCreator = $targetSpace.getCreatorName() )
#set ( $spaceCreationDate = $targetSpace.getCreationDate() )
#set ( $spaceDescription = $targetSpace.getDescription() )
#set ( $pageCount = $spaceManager.findPageTotal($targetSpace) )
#set ( $blogCount = $spaceManager.getNumberOfBlogPosts($targetSpace) )
 
## Get all pages in the current Space
#set ( $allPagesInSpace = $pageManager.getPages($targetSpace, true) )
## Reset total attachment file size
#set ( $totalAttachmentFileSizeForSpace = 0 )
## Reset total number of attachments
#set ( $totalAttachmentCount = 0 )
## Loop through all pages in the current Space
#foreach ($page in $allPagesInSpace)
  ## reset the attachment count for each page
  #set ( $pageAttachmentCount = 0 )
  ## reset the attachment file size total for each page
  #set ( $totalFileSizePerPage = 0 )
  ## get the attachments for each page
  #set ( $allAttachments = $page.getAttachments() )
  ## Loop through each attachment
  #foreach ($attachment in $allAttachments)
    ## Increment the attachment count for the page
   #set ( $pageAttachmentCount = $pageAttachmentCount + 1 )
    ## Sum the size of the attachments on the page
    #set ( $totalFileSizePerPage = $totalFileSizePerPage + $attachment.getFileSize() )
  #end
  ## End looping through attachments
  ## Increment total attachment count for the current Space
  #set ( $totalAttachmentCount = $totalAttachmentCount + $pageAttachmentCount )
  ## Sum the total size of attachments for the current Space
  #set ( $totalAttachmentFileSizeForSpace = $totalAttachmentFileSizeForSpace + $totalFileSizePerPage )
#end
## End looping through pages
 
## Convert attachment size to MBs
#set ( $attachmentSizeMb = ($totalAttachmentFileSizeForSpace / 1024.00) / 1024.00 )
 
## Display Space Details
<table class="confluenceTable">
  <tbody>
    <tr>
      <th class="confluenceTh">Name</th>
      <td class="confluenceTd">$spaceName</td>
    </tr>
    <tr>
      <th class="confluenceTh">Key</th>
      <td class="confluenceTd">$spaceKey</td>
    </tr>
    <tr>
      <th class="confluenceTh">Description</th>
      <td class="confluenceTd">$spaceDescription.getBodyAsString()</td>
    </tr>
    <tr>
      <th class="confluenceTh">Home Page</th>
      <td class="confluenceTd">#contentLink2($spaceHome true false)</td>
    </tr>
    <tr>
      <th class="confluenceTh">Created By</th>
      <td class="confluenceTd">#usernameLink($spaceCreator) ($action.dateFormatter.formatDateTime($spaceCreationDate))</td>
    </tr>
    <tr>
      <th class="confluenceTh">Number of Pages</th>
      <td class="confluenceTd">$pageCount</td>
    </tr>
    <tr>
      <th class="confluenceTh">Number of Blog Posts</th>
      <td class="confluenceTd">$blogCount</td>
    </tr>
    <tr>
      <th class="confluenceTh">Number of Attachments</th>
      <td class="confluenceTd">$totalAttachmentCount (including all versions)</td>
    </tr>
    <tr>
      <th class="confluenceTh">Total Size of Attachments</th>
      <td class="confluenceTd">$attachmentSizeMb MB</td>
    </tr>
  </tbody>
</table>

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

1,919 views 25 10
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