Replacing EBS and Rethinking Postgres Storage from First Principles
1–10 of 63 posts
Re: Replacing EBS and Rethinking Postgres Storage from First Principles
#2Re: Replacing EBS and Rethinking Postgres Storage from First Principles
#3Re: Replacing EBS and Rethinking Postgres Storage from First Principles
#4Postgres for agents, of course! It makes too much sense.
Re: Replacing EBS and Rethinking Postgres Storage from First Principles
#5 E.g. i8g.2xlarge, 1875 GB, 300k IOPS read
vs. WD_BLACK SN8100, 2TB, 2300k IOPS readRe: Replacing EBS and Rethinking Postgres Storage from First Principles
#6Why EBS didn't work:
- EBS costs for allocation
- EBS is slow at restores from snapshot (faster to spin up a database from a Postgres backup stored in S3 than from an EBS snapshot in S3)
- EBS only lets you attach 24 volumes per instance
- EBS only lets you resize once every 6–24 hours, you can't shrink or adjust continuously
- Detaching and reattaching EBS volumes can take 10s for healthy volumes to 20m for failed ones, so failover takes longer
Why all this matters: - their AI agents are all ephemeral snapshots; they constantly destroy and rebuild EBS volumes
What didn't work: - local NVMe/bare metal: need 2-3x nodes for durability, too expensive; snapshot restores are too slow
- custom page-server psql storage architecture: too complex/expensive to maintain
Their solution: - block COWs
- volume changes (new/snapshot/delete) are a metadata change
- storage space is logical (effectively infinite) not bound to disk primitives
- multi-tenant by default
- versioned, replicated k/v transactions, horizontally scalable
- independent service layer abstracts blocks into volumes, is the security/tenant boundary, enforces limits
- user-space block device, pins i/o queues to cpus, supports zero-copy, resizing; depends on Linux primitives for performance limits
Performance stats (single volume): - (latency/IOPS benchmarks: 4 KB blocks; throughput benchmarks: 512 KB blocks)
- read: 110,000 IOPS and 1.375 GB/s (bottlenecked by network bandwidth
- write: 40,000–67,000 IOPS and 500–700 MB/s, synchronousy replicated
- single-block read latency ~1 ms, write latency ~5 msRe: Replacing EBS and Rethinking Postgres Storage from First Principles
#7It's a great way to mix copy on write and effectively logical splitting of physical nodes. It's something I've wanted to build at a previous role.
Re: Replacing EBS and Rethinking Postgres Storage from First Principles
#8There's a ton of jargon here. Summarized... Why EBS didn't work: - EBS costs for allocation - EBS is slow at restores from snapshot (faster to spin up a database from a Postgres backup stored in S3 than from an EBS snapshot in S3) - EBS only lets you attach 24 volumes per instance - EBS only lets you resize once every 6–24 hours, you can't shrink or adjust continuously - Detaching and reattaching EBS volumes can take…
Note that those numbers are terrible vs. a physical disk, especially latency, which should be (That assumes async replication of the write ahead log to a secondary. Otherwise, write latency should be ~ 1 rtt, which is still Stacking storage like this isn’t great, but PG wasn’t really designed for performance or HA. (I don’t have a better concrete solution for ansi SQL that works today.)
Re: Replacing EBS and Rethinking Postgres Storage from First Principles
#9There's a ton of jargon here. Summarized... Why EBS didn't work: - EBS costs for allocation - EBS is slow at restores from snapshot (faster to spin up a database from a Postgres backup stored in S3 than from an EBS snapshot in S3) - EBS only lets you attach 24 volumes per instance - EBS only lets you resize once every 6–24 hours, you can't shrink or adjust continuously - Detaching and reattaching EBS volumes can take…
I did not set that up myself, but the colleague that worked on that told me that enabling tcp multipath for iscsi yielded significant performance gains.
Re: Replacing EBS and Rethinking Postgres Storage from First Principles
#10There's a ton of jargon here. Summarized... Why EBS didn't work: - EBS costs for allocation - EBS is slow at restores from snapshot (faster to spin up a database from a Postgres backup stored in S3 than from an EBS snapshot in S3) - EBS only lets you attach 24 volumes per instance - EBS only lets you resize once every 6–24 hours, you can't shrink or adjust continuously - Detaching and reattaching EBS volumes can take…
Is that even true? I've resized an EBS instance a few minutes after another resize before.