RStudio Connect Reclaim Disk Space

Follow

You may notice that your RStudio Connect server can start occupying a large amount of disk space as users start deploying content.

A large proponent of this disk space can be utilized by published bundles. A bundle is an encapsulated package that contains the source code and data necessary to execute the content that you have published. This is stored in theServer.DataDirthat you have configured. If you have not specified an alternative datadir, then this will be stored in the /var/lib/rstudio-connect directory.

You may notice your /var/lib/rstudio-connect directory or your Server.DataDir is using a large amount of disk space. By default, these bundles are retained indefinitely.  We'd suggest editing your/etc/rstudio-connect/rstudio-connect.gcfgfile to include this setting:

[Applications]
BundleRetentionLimit = 3

BundleRetentionLimit

Maximum number of bundles per app for which we want to retain filesystem data. The default is 0, which means retain everything


This limit is the maximum number of bundles per application that you want to retain on the filesystem.  The default is 0, which means every time an application is re-deployed, the prior application bundle is archived on disk.  For applications which contain large amounts of data, this can easily accumulate and become an issue.

Adjusting the value above to a retention limit of 3, from the default of 0, should help free space without any impact on your users.

 

More information on these directives can be found here:

https://docs.rstudio.com/connect/admin/content-management/#bundle-management
https://docs.rstudio.com/connect/admin/appendix/configuration/#Applications.BundleRetentionLimit

 

By default, 24 hours will then need to pass for this change to take effect. This is due to the Applications.BundleReapFrequency directive which defaults to 24 hours. If you wish for this change to take effect sooner, you can set this value to less. For example:

[Applications] 
BundleReapFrequency = 1h

 

Note that once these directives have been added to your configuration file you will need to restart Connect:

sudo systemctl restart rstudio-connect

 

Support Ticket

If you still have issues after completing the above, you can always lodge a support ticket, where our group of friendly, and incredibly knowledgeable staff can assist with any issues that you may be having. You can submit a ticket here:

https://support.rstudio.com/hc/en-us/requests/new

Comments