Managing Disk Space

Posit Connect can consume significant disk space as users deploy content over time. This page describes the main sources of disk usage and the configuration settings available to manage them.

Most disk usage accumulates in the Connect data directory (Server.DataDir, which defaults to /var/lib/rstudio-connect). You can check the current usage with:

Terminal
du -sh /var/lib/rstudio-connect

Bundle retention

Each deployment creates a new bundle on disk. By default, all previous bundles are retained indefinitely, which can consume significant space.

To limit the number of bundles retained per content item, set Applications.BundleRetentionLimit:

/etc/rstudio-connect/rstudio-connect.gcfg
[Applications]
BundleRetentionLimit = 3

Older bundles are deleted periodically, which runs on the interval defined by Applications.BundleReapFrequency (default: 24h).

Rendering output retention

Rendered content produces output each time it runs. Two settings control automatic cleanup of old renderings:

The cleanup frequency is controlled by Applications.RenderingSweepFrequency (default: 1h).

Python environment cleanup

Python content uses virtual environments stored on disk. Connect removes unused environments automatically. For details on how environment caching works, see Environment caching.

The cleanup interval is controlled by Applications.PythonEnvironmentReapFrequency (default: 24h). To disable cleanup, set Applications.PythonEnvironmentReaping to false.

Job history cleanup

Connect stores metadata and output for completed jobs on disk. Two settings control automatic cleanup:

A job is removed if either limit is exceeded.

Runtime caches

R and Python package caches are not automatically deleted when content is removed. See the Runtime Caches documentation for details on viewing and deleting these caches.

Applying changes

After updating the configuration file, restart Connect for the changes to take effect:

Terminal
sudo systemctl restart rstudio-connect