Live data from Hacker News

IO Devices and Latency

planetscale.com

151–159 of 159 posts

Re: IO Devices and Latency

#151
post #120

Earlier quoted context omitted.

I still measure 1-2ms of latency with an NVMe disk on my Desktop computer, doing fsync() on a file on a ext4 filesystem. Update: about 800us on a more modern system.

NVMe is just a protocol. There are drives that are absolute shit and others that cost as much as luxury automobiles. In either case not quite DRAM latency because it is expansion bus attached.

RIP Optane DIMMs.

Re: IO Devices and Latency

#152
post #114

Earlier quoted context omitted.

1 in a million is the probability that all three servers die in one months, without swapping out the broken ones. So at some point in the month all the data is gone. If you replace the failed(or failing) node right away, the failure percentage goes down greatly. You would likely need the probability of a node going done in 30 minutes time space. Assuming the migration can be done in 30 min. (i hope this calculation i…

One thing I will suggest: you’re assuming failures are non-correlated and have an equally weighted chance per in it of time. Neither is a good assumption from my experience. Failures being correlated to any degree greatly increases the chances of what the aviation world refers to as “the holes in the Swiss cheese lining up”.

You are 100% correct. Heavily depends on where the servers reside. Just a rough estimate for the case that the failures are non related.

Re: IO Devices and Latency

#153

Earlier quoted context omitted.

> Latency and bandwidth can be made 10x worst by process context switching alone. No they can't. That doesn't even make sense as a claim regarding bandwidth since SQLite doesn't use any, but please re-read what I said about being a 1% or 5% difference in speed. Not 10x.

Yes they absolutely can. Same-core context switching costs a few microseconds. Going across core complexes can cost tens to hundreds of microseconds. These figures are several orders of magnitude (5-6) slower than L1 access on the same thread.

Hundreds of microseconds? L1 access? I don't have the faintest idea of what you're talking about.

Communication between processes is negligible compared to all of the sequential disk/SSD accesses and processing required for executing queries.

The database isn't stored in L1 and communication isn't taking hundreds of microseconds. I don't know where you're getting your information.

The fact that SQLite is in-process is primarily about simplicity and convenience, not performance. Performance can even be worse, e.g. due to the lack of a query cache.

Re: IO Devices and Latency

#154

Earlier quoted context omitted.

For PlanetScale Metal, we use semi-sync replication. The primary need to get an ack from at least one replica before committing.

Soo... We have a network hop after all?

For writes, yes. But what if your workload is 90% reads?

Re: IO Devices and Latency

#155

Earlier quoted context omitted.

Soo... We have a network hop after all?

For writes, yes. But what if your workload is 90% reads?

It makes a lot of sense for read-heavy workloads, for sure!

I was just trying to get a better understanding of what is happening under the hood :)

Re: IO Devices and Latency

#156
post #113

For years, I just didn't get why replicated databases always stick with EBS and deal with its latency. Like, replication is already there, why not be brave and just go with local disks? At my previous orgs, where we ran Elasticsearch for temporary logs/metrics storage, I proposed we do exactly that since we didn't even have major reliability requirements. But I couldn't convince them back then, we ended up with even…

There are a number of axes of performance that aren't covered in this [wonderful] article on storage performance. One of these is that EBS allows you to scale the VM up / down to change the amount of CPU & RAM available to process data on disk. We run several hundred ClickHouse clusters on this model. Rescaling to address performance issues is far more common than failures.

Example; you get a tenant performance issue on Sunday morning US time. The simplest fix is often rescale to a larger VM for the weekend, then get the A team working on the root cause first thing Monday. The incremental cost is minimal and avoids far more costly staff burnout.

Re: IO Devices and Latency

#157
post #122

If this is true, then how do "serverless" database providers like Neon advertise "low latency" access? They use object storage like S3, which I imagine is an order of magnitude worse than networked storage for latency. edit: apparently they build a kafkaesque layer of caching. No thank you, I'll just keep my data on locally attached NVMe.

> edit: apparently they build a kafkaesque layer of caching. No thank you, I'll just keep my data on locally attached NVMe.

I can't speak to Neon specifically but I've worked a lot with analytic databases, which often use NVMe SSD caches to operate efficiently on S3 data. For time-ordered datasets like observability (e.g., metrics) most queries go to recent data which in the steady state is not just in NVMe SSD storage but generally RAM as well if you are properly tuned. For example, indexes and other metadata are permanently cached.

In realistic tests of the above scenario the effect of nVME SSD can be surprisingly muted. That's especially true if you can use clusters that spread processing across multiple compute nodes, which gives you more RAM to play with and also multiplies storage bandwith.

There are downsides to S3 of course like restarts, which require management to avoid performance issues.

Re: IO Devices and Latency

#158
post #3

Author of the blog here. I had a great time writing this. By far the most complex article I've ever put together, with literally thousands of lines of js to build out these interactive visuals. I hope everyone enjoys.

I was delighted to see your models of tape operations as I used it a lot in the COBOL days.

For reasons discussed in your article we would arrange tape processing as much as possible in sequential scans, something at which COBOL was quite excellent. One of the common performance problems was when there was a mismatch between a slower COBOL processing speed that could not keep up with the flow of blocks coming off the drive head.

In this case you would see the drive start to overshoot as it read more blocks than the COBOL program could handle. The drive would begin a painful jump forward/spool backward motion which made the performance issue quite visible. You would then eyeball the code to understand way the program was not keeping up, correct, and resubmit until the motion disappeared.

Re: IO Devices and Latency

#159
post #3

Author of the blog here. I had a great time writing this. By far the most complex article I've ever put together, with literally thousands of lines of js to build out these interactive visuals. I hope everyone enjoys.

Your style of explaination and animation are exceptional.
Post reply on HN