So you need that m4.16xlarge to handle the load, and honestly, there's no single instance available on Amazon that I've found that can come anywhere near the performance of physical hardware when it comes to handling database loads. Right now I am running ten r4.16xlarge instances to do the job of two Dell R710s, at considerably reduced performance even still.
I do run a database on my server (which isn't even a Large) for an e-commerce site. It fits handily in half a gig of ram. The hundreds of products we offer have associated images, but we just store the filenames in the database and they load from disk (or, more likely, Cloudflare cache). Honestly, it could be a static site but the database is a convenient way to edit the content and control the presentation.
You have 640 CPUs running at multiple gigahertz and trillions of bytes of RAM. What kind of workload requires that insane amount of compute power?
Part of the problem is that the network disk that EC2 provides as EBS is 100x slower than local disk, so keeping all the indexes and data in memory is the only way to replicate physical hardware performance.
If anyone knows of a better EC2 setup for PostgreSQL, I'm all ears.
> If anyone knows of a better EC2 setup for PostgreSQL, I'm all ears.
Have a proper replication & archiving setup, and use instance storage. If you have configured streaming replication to 1-2 other servers, and archive your WAL to s3 (using wal-e or such), you're already above EBS's guarantees (99.9% durability IIRC?).
Still doesn't even remotely compete with what you can get with "normal" hardware.