News for hackers. Stuff that matters.
Re:Serving a half billion requests per day with Rust and CGI by rokob on Wednesday July 09, 2025 @09:46AM (#44509998)
I’m interested why Rust and C have similarly bad tail latencies but Go doesn’t.
Re:Serving a half billion requests per day with Rust and CGI by scraptor on Wednesday July 09, 2025 @11:15AM (#44511051)
sqlite resolves lock contention between processes with exponential backoff. When the WAL reaches 4MB it stops all writes while it gets compacted into the database. Once the compaction is over all the waiting processes probably have retry intervals in the hundred millisecond range, and as they exit they are immediately replaced with new processes with shorter initial retry intervals. I don't know enough queuing theory to state this nicely or prove it, but I imagine the tail latency for the existing processes goes up quickly as the throughput of new processes approaches the limit of the database.
Re:Serving a half billion requests per day with Rust and CGI by rokob on Saturday July 12, 2025 @08:33AM (#44541605)
That is interesting, I’ll have to look into that further. I would expect Go to have similar issues because the RPS isn’t that much less. But maybe there is some knife edge here.
Re:Serving a half billion requests per day with Rust and CGI by twh270 on Wednesday July 09, 2025 @10:07AM (#44510225)
OP posited SQLite database contention. I don't know enough about this space to agree or disagree. It would be interesting, and perhaps illuminating, to perform a similar experiment with Postgres.
Re:Serving a half billion requests per day with Rust and CGI by bracketfocus on Wednesday July 09, 2025 @10:08AM (#44510235)
The author guessed it was a result of database contention.

I’d also be interested in getting a concrete reason though.