Earlier quoted context omitted.
Ah yeah, getting good kernel userspace oneshot memcpy performance for large files is surprisingly hard. mmap has setup/teardown overhead that's significant for oneshot transfers, regular read/write calls suffer from page cache/per page overhead. Hopefully all the large folio work in the kernel will help with that.
Well, nowadays there is https://www.phoronix.com/news/Linux-RWF_UNCACHED-2024
Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O
71–80 of 159 posts
Re: Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O
#72I recently deployed Postgres on a dedicated Hetzner EX-44 server (20 cores, 64GB RAM, 2x 512GB NVMe SSDs in RAID 1) for €39/month. The price-to-performance ratio is exceptional, providing enterprise-level capacity at a fraction of typical cloud costs. For security, I implemented TailScale which adds only ~5ms of latency while completely eliminating public network exposure - a worthwhile tradeoff for the significant s…
Would you be willing to open source the setup ? I would love to learn from it.
Re: Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O
#73Earlier quoted context omitted.
Can you elaborate on this B-tree part of your comment? I know B-tree is the default index type in pg, but it sounds like there’s more to the story that I’m not familiar with.
PostgreSQL uses heap files for the primary table storage, not B-trees. In PostgreSQL table data is primarily stored in heap files (unordered collections of pages/blocks). Indexes (including primary key indexes) use B-trees (specifically B+ trees). When you query a table via an index, the B-tree index points to locations in the heap file InnoDB uses a clustered index approach. The primary key index is a B-tree. The ac…
Re: Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O
#74Earlier quoted context omitted.
> given even a consumer $100-200 NVMe gives ~1million+ IOPS these days In the face of sustained writes? For how long?
sustained reads would not even give 1 mio iops in that case. Maybe wen you only read the same file that fits into the nvme cache. Which probably never happens in a production database..
I don't think sustained reads are a problem? Benches like the CrystalDiskMark do a full disk random read test; they're designed to bust through cache afaik. 7.2GBp of 4k reads would translate to 1.8MIOps. Even if this is massively optimistic, you need to slash a lot of zeroes/orders of magnitude to get down to 20kIOps, which you will also pay >$100/mo for.
Re: Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O
#75Re: Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O
#76Earlier quoted context omitted.
sustained reads would not even give 1 mio iops in that case. Maybe wen you only read the same file that fits into the nvme cache. Which probably never happens in a production database..
Samsung 9910 has a 1:1 TB:GB cache size of LPDDR4X memory. I won't pretend to understand the magic NVMe drives possess, but if you got a 4TB or 8TB 9910, could you not in theory pull in all of the data you require to cache? I would assume, and it might be a poor assumption, that NVMe controllers don't pull in files, but rather blocks, so even if you had a database that exceeded cache size, in theory if the active blo…
Re: Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O
#77Earlier quoted context omitted.
Well, nowadays there is https://www.phoronix.com/news/Linux-RWF_UNCACHED-2024
That doesn't speed up uerspace kernel memcopy, it just reduces cache churn. Despite its name it still goes through the page cache, it just triggers writeback and drops the pages once that's done. For example when copying to a tmpfs it makes zero difference since that lives entirely in memory.
Re: Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O
#78A lot of work has gone into FreeBSD's aio(4) so it will be interesting to see how that works, because it doesn't have the drawbacks of Linux/glibc aio.
Is FreeBSD doing anything significantly different and/or better?
Re: Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O
#79Earlier quoted context omitted.
My understanding is this not true, only when the instance permanently fails and is moved.
stop or hibernate kills it. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance...
Which means you can count on it about as much as a server of your own, if you could not repair the server.
I know a database company that uses instance storage as the primary storage. It’s common.
Re: Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O
#80Are there good performance comparisons between postgres, mariadb and percona? I'm really curious at this point in which case each of those database shine.