← Graph

Replace SQLite's C busy_timeout with a GVL-releasing Ruby handler

takeaway 3 connections

SQLite's native busy_timeout is a C callback that keeps holding Ruby's GVL during its waits, preventing other Puma workers from doing Ruby work. Re-implementing the busy_handler in Ruby with Kernel#sleep releases the GVL and lets SQLite I/O behave as external I/O, flattening the latency curve.

type
recommendation
takeaway Replace SQLite's C busy_timeout with a GVL-releasing Ruby handler
about
The recommendation is about implementing the busy_handler in Ruby.
takeaway Replace SQLite's C busy_timeout with a GVL-releasing Ruby handler
about
The point of the fix is to release the GVL during DB waits.
takeaway Replace SQLite's C busy_timeout with a GVL-releasing Ruby handler
from_talk
Fix #2 in the talk's performance journey.

Provenance

Read by
1 extraction