Bolt database

Database Connection Leak - Connections Never Close

Database connections accumulate over time. Pool reaches max connections and new queries fail. Eventually app becomes completely unresponsive.

Connection count grows with each request and never decreases.

Error Messages You Might See

Error: too many connections Error: no more connections available Connection pool exhausted Connection not returned to pool
Error: too many connectionsError: no more connections availableConnection pool exhaustedConnection not returned to pool

Common Causes

  1. Not awaiting database queries properly
  2. Promise not being resolved/rejected
  3. Connection created but not returned to pool
  4. Long-running queries holding connections indefinitely
  5. Error in query handler not releasing connection

How to Fix It

Always await database calls: await prisma.user.findUnique(...)

Use try/finally to ensure cleanup: try { await db.query(...) } finally { await client.release() }

Set query timeout: Prisma has built-in, use setTimeout for others

Check connection pool size: should be reasonable for concurrent users

Monitor connections: SELECT count(*) FROM pg_stat_activity in PostgreSQL

Real developers can help you.

rayush33 rayush33 JavaScript (React.js, React Native, Node.js) Developer with demonstrated industry experience of 4+ years, actively looking for opportunities to hone my skills as well as help small-scale business owners with solutions to technical problems Taufan Taufan I’m a product-focused engineer and tech leader who builds scalable systems and turns ideas into production-ready platforms. Over the past years, I’ve worked across startups and fast-moving teams, leading backend architecture, improving system reliability, and shipping products used by thousands of users. My strength is not just writing code — but connecting product vision, technical execution, and business impact. Krishna Sai Kuncha Krishna Sai Kuncha Experienced Professional Full stack Developer with 8+ years of experience across react, python, js, ts, golang and react-native. Developed inhouse websearch tooling for AI before websearch was solved : ) Dor Yaloz Dor Yaloz SW engineer with 6+ years of experience, I worked with React/Node/Python did projects with React+Capacitor.js for ios Supabase expert Antriksh Narang Antriksh Narang 5 years+ Experienced Dev (Specially in Web Development), can help in python, javascript, react, next.js and full stack web dev technologies. ISHANTDEEP SINGH ISHANTDEEP SINGH Senior Software Engineer with 7+ years of experience in React, JavaScript, TypeScript, Next.js, and Node.js. I’ve also worked as a tech lead for startups, owning end-to-end technical execution including architecture, development, scaling, and delivery. I bring a strong mix of hands-on coding, product thinking, and technical leadership, and I’m comfortable building products from scratch as well as improving and scaling existing systems. Stanislav Prigodich Stanislav Prigodich 15+ years building iOS and web apps at startups and enterprise companies. I want to use that experience to help builders ship real products - when something breaks, I'm here to fix it. Sage Fulcher Sage Fulcher Hey I'm Sage! Im a Boston area software engineer who grew up in South Florida. Ive worked at a ton of cool places like a telehealth kidney care startup that took part in a billion dollar merger (Cricket health/Interwell health), a boutique design agency where I got to work on a ton of exciting startups including a photography education app, a collegiate Esports league and more (Philosophie), a data analytics as a service startup in Cambridge (MA) as well as at Phillips and MIT Lincoln Lab where I designed and developed novel network security visualizations and analytics. I've been writing code and furiously devoted to using computers to make people’s lives easier for about 17 years. My degree is in making computers make pretty lights and sounds. Outside of work I love hip hop, the Celtics, professional wrestling, magic the gathering, photography, drumming, and guitars (both making and playing them) Matt Butler Matt Butler Software Engineer @ AWS Rudra Bhikadiya Rudra Bhikadiya I build and fix web apps across Next.js, Node.js, and DBs. Comfortable jumping into messy code, broken APIs, and mysterious bugs. If your project works in theory but not in reality, I help close that gap.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

How do I check active connections?

PostgreSQL: SELECT count(*) FROM pg_stat_activity. Should be < max_connections setting

What's a good connection pool size?

Prisma default is 5. Increase for more concurrent users, but don't exceed database limit

Why do connections leak?

Not awaiting promise, error thrown before release, or forgetting to return connection to pool

Related Bolt Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help