by bob1029 · 1mo ago · 0 comments
Kestrel (AspNetCore) + SQLite + NVMe all on the same machine is where things start to get really spicy in my experience. Imagine handling an entire form submission that mutates database state in tens to low-hundreds of microseconds. Total wall clock time required to service any HTTP request can be well under a single millisecond. If your average cpu time per request is 30uS, you could approach half a million per second on a 16-32 core machine.
optane
Edit: optane also shows what the SSD/nvme sequential-throughput marketing wars have cost us. Latency and random 4k iops always should have been the focus (in research, development, reviews, and benchmarks), not sequential throughput.
If the pricing is competitive it will easily be replacing DRAM for many lower-level uses, thanks to its support for better PCIe standards (5.0 at least, while aftermarket Optane is stuck on 4.0).
I love toying with optane stuff but yeah it's starting to show it's age and the gen4 gear is both old-ish and still expensive.
So a new toy would be cool
In a load test with 512 players all active on one world, command acks were 4-6 ms at the median and under 50 ms at p95, on a single Ryzen 9 3900X box. And most of that time is game logic and fanning out updates over websockets, not the database.
The part people worry about is durability, because SSDs have limited write cycles. So I took care to have backups of the state, recovery in short time etc.
I stream the WAL to object storage with Litestream, with one gotcha: I had to turn off SQLite’s own auto-checkpoint and let only Litestream checkpoint, or the two step on each other.
SQLite does a great job to support single writer and multiple readers. That's what we use for aggregation right now. DuckDB is purely post analytics.