Configuring Cell Disk Cleanup Scheduling
This topic describes how to configure disk cleanup scheduling on Diego cells in Pivotal Cloud Foundry (PCF).
PCF isolates application instances (AIs) from each other using containers that run inside Diego cells. Containers enforce a set of isolation layers including file system isolation. A PCF container file system can either be a PCF stack or the result of pulling a Docker image.
For performance reasons, the cells cache the Docker image layers and the PCF stacks used by running AIs. When PCF destroys an AI or reschedules an AI to a different cell, a chance exist that certain Docker image layers or an old PCF stack becomes unused. If PCF does not clean these unused layers, the cell ephemeral disk will slowly fill.
Disk cleanup is the process of removing unused layers from the cell disk. The disk cleanup process removes all unused Docker image layers and old PCF Stacks, regardless of their size or age.
To perform a detailed analysis of disk usage in your PAS deployment, see Examining GrootFS Disk Usage.
PCF provides the following options for scheduling the disk cleanup process on Diego cells:
- Never clean up the Cell disk-space: Pivotal does not recommend selecting this option for production environments.
- Routinely clean up the Cell disk-space: This option makes the 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 cell performance.
- Clean up disk-space once usage fills disk: This option makes the cell schedule the disk cleanup process only when disk usage encroaches on the space reserved for other jobs.
See the Configure Disk Cleanup Scheduling section of this topic to select one of these options.
To select the best option for disk cleanup, you must consider the workload that the Diego cells run.
For PCF installations that primarily run buildpack-based apps, Pivotal recommends selecting the Routinely clean up Cell disk-space option. The Routinely clean up 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 PCF 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.
By default, the space reserved for other jobs is set to a reasonable value for the majority of PCF deployments.
The reserve default value accounts for the most typical deployment case where the only other component that
/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.
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.
Navigate to the PCF Operations Manager Installation Dashboard.
Click the Pivotal Application Service (PAS) tile, and navigate to the Application Containers tab.
Under Docker Images Disk-Cleanup Scheduling on Cell VMs, select an option.
If you select Clean up disk-space once usage fills disk, you can modify the Reserved amount of Disk (MB) field. Pivotal recommends that you leave the default value of
15360MB, or 15GB, in Reserved amount of Disk (MB) unless you are instructed to change it. For more information, see Calculating a Reserve.
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 PCF Ops Manager Installation Dashboard, click Review Pending Changes, and click Apply Changes.