Configuring Cell Disk Cleanup Scheduling

Page last updated:

This topic describes how to configure disk cleanup scheduling on Diego Cells in Pivotal Platform.

Overview

Pivotal Platform isolates app instances (AIs) from each other using containers that run inside Diego Cells. Containers enforce a set of isolation layers, including file system isolation. A Pivotal Platform container file system can either be a Pivotal Platform stack or the result of pulling a Docker image.

For performance reasons, the Diego Cells cache the Docker image layers and the Pivotal Platform stacks used by running AIs. When Pivotal Platform destroys an AI or reschedules an AI to a different Diego Cell, a chance exist that certain Docker image layers or an old Pivotal Platform stack becomes unused. If Pivotal Platform does not clean these unused layers, the cell ephemeral disk slowly fills.

Disk cleanup is the process of removing unused layers from the Diego Cell disk. The disk cleanup process removes all unused Docker image layers and old Pivotal Platform Stacks, regardless of their size or age.

To perform a detailed analysis of disk usage in your Pivotal Application Service (PAS) deployment, see Examining GrootFS Disk Usage.

Options for Disk Cleanup

Pivotal Platform provides the following options for scheduling the disk cleanup process on Diego Cells in the App Containers pane of the PAS tile:

  • Never clean up Diego Cell disk space: Pivotal does not recommend selecting this option for production environments.

  • Routinely clean up Diego Cell disk space: This option makes the Diego Cell schedule a disk cleanup whenever a container is created. Running the disk cleanup process this frequently can result in a negative impact on the Diego Cell performance.

  • Clean up disk space once usage fills disk: This option makes the Diego Cell schedule the disk cleanup process only when disk usage encroaches on the space reserved for other jobs.

For more information about these options, see Configure Disk Cleanup Scheduling.

Recommendations

To select the best option for disk cleanup, you must consider the workload that the Diego Cells run.

For Pivotal Platform installations that primarily run buildpack-based apps, Pivotal recommends selecting the Routinely clean up Diego Cell disk space option. The Routinely clean up Diego Cell disk space option ensures that when a new stack becomes available on a cell, the old stack is dropped immediately from the cache.

For Pivotal Platform installations that primarily run Docker images, or both Docker images and buildpack-based apps, Pivotal recommends selecting the Clean up disk space once usage fills disk option.

Calculating a Reserve

By default, the space reserved for other jobs is set to a reasonable value for the majority of Pivotal Platform deployments. The reserve default value accounts for the most typical deployment case where the only other component that writes to /var/vcap/data is the Diego executor cache.

However, if you are deploying any BOSH add-ons that require space in the ephemeral disk, you may need to increase the reserve.

For more information on disk usage and garbage collection in GrootFS, see GrootFS Disk Usage and Examining GrootFS Disk Usage.

Warning: Setting the reserve to an excessive value can cause garbage collection to occur more frequently. An increase in frequency can result in regular slowdowns in performance of apps on particular Diego Cells. Pivotal recommends leaving the default value for the reserve unless you are advised to modify it.

Configure Disk Cleanup Scheduling

  1. Navigate to the Pivotal Platform Ops Manager Installation Dashboard.

  2. Click the Pivotal Application Service (PAS) tile, and navigate to App Containers. At the top of the image is the text 'Docker images disk cleanup scheduling on Diego Cell VMs', with a red asterisk to denote that it is a required field. Below this text are three radio buttons: two radio buttons labeled 'Never clean up Diego Cell disk space' and 'Routinely clean up Diego Cell disk space', and one selected radio button labeled 'Clean up disk space once usage fills disk'. Below the selected radio button is a field labeled 'Reserved disk space for other jobs ( min: 15360 )', with a red asterisk, containing the text '15360'.

  3. Under Docker images disk cleanup scheduling on Diego Cell VMs, select an option.

  4. If you select Clean up disk space once usage fills disk, you can modify the Reserved disk space for other jobs field. Pivotal recommends that you leave the default value of 15360 MB, or 15 GB, in Reserved disk space for other jobs unless you are instructed to change it. For more information, see Calculating a Reserve.

  5. Click Save.

Next Steps

If you are configuring PAS for the first time, return to your specific IaaS configuration to continue the installation process.

If you are modifying an existing PAS installation, return to the Ops Manager Installation Dashboard, click Review Pending Changes, and click Apply Changes.