Intermittent connection stalls between Vercel serverless functions and Supabase's transaction pooler
Unanswered
Ariegeois posted this in #help-forum
AriegeoisOP
Low-traffic Next.js apps on Vercel Fluid Compute occasionally freeze on cold starts when connecting to Supabase's transaction pooler (port 6543) via postgres.js + Drizzle. The page loading skeleton hangs indefinitely, eventually hitting React error #412 or Vercel's 30-second maxDuration timeout.
Root Cause
The issue is a connection handshake stall during Vercel serverless cold starts. During module initialization, CPU saturation on the Vercel instance starves the Node.js event loop. The TCP socket opens, but the client fails to respond to Supavisor's auth challenge in time. Supavisor logs ClientHandler: Timeout while waiting for message in state SCRAM, leaving the Vercel function hanging until it times out. High-traffic apps stay warm and avoid this, but low-traffic apps hit fresh handshakes on almost every request.
Root Cause
The issue is a connection handshake stall during Vercel serverless cold starts. During module initialization, CPU saturation on the Vercel instance starves the Node.js event loop. The TCP socket opens, but the client fails to respond to Supavisor's auth challenge in time. Supavisor logs ClientHandler: Timeout while waiting for message in state SCRAM, leaving the Vercel function hanging until it times out. High-traffic apps stay warm and avoid this, but low-traffic apps hit fresh handshakes on almost every request.