← Graph

Release DB connections around external HTTP calls

takeaway 1 connections

Lesson from Caio Almeida's Brazil elections war story: a Rails API opened a DB transaction (and thus held a DB connection) for the entire duration of a synchronous external HTTP call to a Python Lambda. Under load the connection pool filled up with idle-but-open connections causing contention even though no DB activity was happening. Fix: close or release the DB connection around external calls that don't touch the database.

type
lesson-learned
takeaway Release DB connections around external HTTP calls
from_talk
Lesson from Caio's Brazil elections debugging story.

Provenance

Created in
Performance Panel at wroclove.rb 2024 2026-04-17 23:20
Read by
1 extraction