2

Stopping and deleting old versions and instances in my project doesn't seem to free up disk space. After stopping and deleting a working instance and then spinning up a new instance I get error messages related to disk space (health_check returns unhealthy, i get logs of vm_check_disk_space.sh). I know this is related to disk space as I can resolve the issue by raising resources: disk_size_gb in my app.yaml and redeploying.

My project is 15gb so it's essential that deleted versions and instances don't bloat my project. How can I go about freeing up unused space?

For reference this is my app.yaml (and with a project size of 15gb this should be more than enough?)

runtime: custom
env: flex

manual_scaling:
  instances: 1

resources:
 cpu: 1
 memory_gb: 1.5
 disk_size_gb: 40

1 Answers1

4

The docker image used for a specific version is built at deployment time and doesn't normally include other versions of your app (unless they are also present in your deployment directory). So stopping instances for or deleting other versions in the developer console has no impact on the already built docker image.

Increase the deployment verbosity (see --verbosity in gcloud) to see what exactly is included in the image being built then re-deploy while looking for unwanted files/directories. Then use the skip_files configuration option in app.yaml (see General settings) to skip them, if any. A typical such example would be the app's .git directory, for example. Repeat until you're happy with what's included in the docker image.

If you still encounter the problem after skipping unwanted files it could mean that your custom runtime is simply too big for the app's disk size configuration, so you'll have to increase it.

Note that the disk may be used for storing data generated at runtime as well, not only for storing your app and environment code, so you may need to investigate runtime usage as well, see Debugging an Instance.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97