Cloudflare Workers tip: loop cron work back near your DB, p90 queries drop 75%

DanielLockyer · x · 2026-10-04

Engineer @dylanga shared a Cloudflare Workers optimization: with region placement, cron and queue triggers run wherever there's excess compute at execution time — often SEA during US business hours — sending database requests on multiple round-the-globe trips and holding connections far longer than necessary.

The fix: have the agent make an internal loop back so the actual work executes closer to the database. After the change, p90 query latency dropped by 75%. A directly actionable architecture detail for developers running database-heavy workloads on Cloudflare.

Original post →

More from coding & agent

coding & agent channel →