Question on autoscaling and volumes

Hi,

I’ve been re-reading the scaling docs, and it seems that each app instances requires it’s own volume?

I’m storing 15GB of images on there - ideally I would just have one volume and mount it to each app instance - is that possible? If not how best to keep all the volumes in sync?

Volumes can only be used by a single VM at a time (they’re basically just local disks that stick around between reboots).

Syncing data between volumes is a hard problem :tm:.

For apps that need multiple VMs, most people end up writing files to S3 or similar. Then they treat the local disks as a cache. We do this for our docker registry, we use Minio as a caching gateway on each instance and point them all at the same S3 bucket.

What is your app doing with files? If you need to write to a local file system that’s “shared” across a bunch of VMs, you can look at exotic clustered filesystems like GlusterFS. That’s complex though.

Its just really storing images, i’m going to try using the statics cache to reduce the number of requests, perhaps we can get away without autoscaling and hard code two instances once that’s done.

Out of interest is there a way to sync two volumes manually - easily :slight_smile:

There’s not an easy, easy way. Do you want these synced continuously?

We’re going to release snapshot/restore on volumes soon. This’ll let you “clone” a volume within an app, which is useful for a one time sync. But it won’t help for continuous.

Ok, thanks @kurt for now we’ll just scale vertically

1 Like

I am also very interested in this topic.

A good example usage is distributed search engine, where the data is persisted on disk. Fly will make this a breeze, but the data needs to be synced between the volumes.