-1

I run a small forum on an Amazon EC2 Instance. It uses a 50GB "gp2" volume. From time to time I make a "snapshot" while the server is on. How does the snapshot system handle the site during live file writes? If developers are uploading files thru and users are posting on the forums at the time. How would a restored server work? Would the entire site backup result in a "corrupted system". I know files made after the last backup would be gone. But what about files that were "in-write" during the snapshot. Would those files be corrupted? Or does the snapshot system keep up with the IO Queue?

1 Answers1

3

This is covered quite well in the documentation.

So long as the volume isn't being written to at the second it's being read, and is in a consistent state, the snapshots should be fine. If you want a guaranteed perfect snapshot you should quiescence writes to the disk before starting the snapshot - the easiest way to do that is to stop the instance. If the instance is writing to the volume when the write is happening then yes it could be corrupt, though I suspect only that file will have a problem. If it's writing to the database that could be an issue. Using RDS for the database would avoid this problem. You can probably suspend database writes though.

If you stop the instance to take a consistent snapshot, as soon as the snapshot is started (not complete, started) you can start using the disk again and your snapshot will be consistent - they're asynchronous. Your I/O may be a bit slower until it completes.

You can easily do a restore test to a spot instance to test your snapshots. Might cost you $0.10.

Tim
  • 31,888
  • 7
  • 52
  • 78