Search code examples
google-app-engine

Google App Engine (GAE) - do instances use a shared disk?


I'm using Google App Engine (GAE) and my app.yaml looks like this:

runtime: custom # uses Dockerfile
env: flex

manual_scaling:
  instances: 2
resources:
  cpu: 2
  memory_gb: 12
  disk_size_gb: 50

The 50GB disk, is it shared between instances? The docs are silent on this issue. I'm downloading files to the disk and each instance will need to be able to access the files I am downloading.

If the disk is not shared, how can I share files between instances?

I know I could download them from Google Cloud storage on demand, but these are video files and instant access is needed for every instance. Downloading the video files on demand would be too slow.

Optional Reading

The reason instant access is needed is because I am using ffmpeg to produce a photo from the video at frame X (or time X). When a photo of the video is taken, these photos need to be made available to the user as quickly as possible.


Solution

  • You are using 50 Gb disk in your GAE, be it standard or flex, there is no way you can share instances between GAE, as the storage is dedicated. You tried GCS, since video file processing is involved and GCS is object based storage. So the alternative to this could be Filestore but it is not yet supported for GAE Flex despite the possibility of SSH into its underlying fully-managed machine.

    There is a way if you use the /tmp folder. However, it will store files in the RAM of the instance, so note that it will take up memory and that it is temporary (as the folder's name suggests).

    For more details, see the documentation here or here.