← Graph

Use a fair retry interval for SQLite writes

takeaway 2 connections

SQLite's shipped busy-timeout algorithm waits up to 100 ms per retry after 12 iterations, penalizing older queries relative to new arrivals and producing p99.9 long-tail latency. A constant 1 ms retry is fair and flattens p99.9. Margheim's patch is in the sqlite3 gem main branch and aimed at Rails 8.

type
insight
takeaway Use a fair retry interval for SQLite writes
about
Fair 1 ms retry is a property of the Ruby busy_handler.
takeaway Use a fair retry interval for SQLite writes
from_talk
Fix #3 in the talk's performance journey.

Provenance