sqlite-bench

Dev tools

benchmarking tool

SHOW HN2024

128points
21comments
#667of 3,515 in 2024
Top 19%of 2024 by points

How HN took it

QuietFewer than 5 comments about the project

2 positive, 2 neutral or asking, 0 mixed, 0 critical, out of 4 comments about the project.

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Commenters found the SQLite concurrency discussion and the maker's answers useful.

    From 3 comments
    • Thanks for the interesting article. Lots of things seem to happen in SQLite land at the moment and I appreciate that the SQLite team documents their quirks so openly, it gives…
      leononame on HN
    • Valuable info and links, instant bookmarks, thank you! If you don't mind me asking, why did you go with rusqlite + a tokio wrapper for it and not go with sqlx?
      pdimitar on HN
    • You get concurrency in SQLite by using multiple connections - and typically a dedicated thread per connection. When using async wrappers, a good solution is connection pooling…
      matharmin on HN

Objections

  • Synchronous file I/O can block application threads in SQLite async wrappers.

    From 2 comments
    • It's a made up example to clarify whether I understand potential congestion scenarios and limitations correctly, not my actual situation. If I had a server with 100 cores to…
      leononame on HN
    • If synchronous IO is blocking your CPU bound application code, this won't help you. My made up example was not about concurrent writes, and the concurrent reads I mentioned were…
      leononame on HN

Questions

  • How many reader connections or threads are optimal relative to CPU count?

    From 2 comments
    • Thanks for your answer. 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…
      leononame on HN
    • I went through the same mental process as you and also use num_cpus [0] but this is based only on intuition that is likely wrong. More benchmarking is needed as my benchmarks…
      seddonm1 on HN
  • Whether to pool connections or open and close per request, and whether open handles block checkpointing.

    From 2 comments
    • Thanks for the interesting article. Lots of things seem to happen in SQLite land at the moment and I appreciate that the SQLite team documents their quirks so openly, it gives…
      leononame on HN
    • You get concurrency in SQLite by using multiple connections - and typically a dedicated thread per connection. When using async wrappers, a good solution is connection pooling…
      matharmin on HN

Alternatives named

  • libsql (Turso) for Rust and Node async access to SQLite.

    From 1 comment
    • Libsql fork has good rust <-> node async, you could look at them for inspiration. Maintained by Turso.
      jitl on HN
  • Postgres for high-concurrency server workloads.

    From 1 comment
    • If you have a server with 100 cores to serve 100 connections simultaneously - and really need this setup -, you should probably be using Postgres or smth else.
      rmbyrro on HN
  • sqlite_async for Dart and datasette's Python thread-pool wrapper.

    From 2 comments
    • You get concurrency in SQLite by using multiple connections - and typically a dedicated thread per connection. When using async wrappers, a good solution is connection pooling…
      matharmin on HN
    • I wrote an async wrapper around SQLite in Python - I'm using a thread pool: https://github.com/simonw/datasette/blob/main/datasette/database.py I have multiple threads for reads…
      simonw on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/40990641)