|
|
|
|
|
by seddonm1
695 days ago
|
|
Thanks. All good and valid questions. 1. I work mostly in Rust so I'll answer there in terms of async. This library [0] uses queues to manage workload. I run a modified version [1] which creates 1 writer and n reader connections to a WAL backed SQLite and dispatch async transactions against them. The n readers will pull work from a shared common queue. 2. Yes there is not much you can do about file IO but SQLite is still a full database engine with caching. You could use this benchmarking tool to help understand where your limits would be (you can do a run against a ramdisk then against your real storage). 3. As per #1, I keep connections open and distribute transactions across them myself. Checkpointing will only be a problem under considerable sustained write load but you should be able to simulate your load and observe the behavior. The WAL2 branch of SQLite is intended to prevent sustained load problems. [0]: https://github.com/programatik29/tokio-rusqlite
[1]: https://github.com/seddonm1/s3ite/blob/0.5.0/src/database.rs |
|
For 1, what is a good n? More than NUM_CPU probably does not make sense, right? But would I want to keep it lower?
Also, you dispatch transactions in your queue? You define your whole workload upfront, send it to the queue and wait for it to finish?