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

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.

Jared Hasson Jared Hasson Full time lead founding dev at a cyber security saas startup, with 10 yoe and a bachelor's in CS. Building & debugging software products is what I've spent my time on for forever prajwalfullstack prajwalfullstack Hi Im a full stack developer, a vibe coded MVP to Market ready product, I'm here to help Anthony Akpan Anthony Akpan Developer with 8 years of experience building softwares fro startups Yovel Cohen Yovel Cohen I got a lot of experience in building Long-horizon AI Agents in production, Backend apps that scale to millions of users and frontend knowledge as well. Basel Issmail Basel Issmail ’m a Senior Full-Stack Developer and Tech Lead with experience designing and building scalable web platforms. I work across the full development lifecycle, from translating business requirements into technical architecture to delivering reliable production systems. My work focuses on modern web technologies, including TypeScript, Angular, Node.js, and cloud-based architectures. I enjoy solving complex technical problems and helping teams turn product ideas and prototypes into working platforms that can grow and scale. In addition to development, I often collaborate closely with product managers, business analysts, designers, and QA teams to ensure that solutions align with both technical and business goals. I enjoy working with startups and product teams where I can contribute both as a hands-on engineer and as a technical partner in designing and delivering impactful software. Franck Plazanet Franck Plazanet I am a Strategic Engineering Leader with over 8 years of experience building high-availability enterprise systems and scaling high-performing technical teams. My focus is on bridging the gap between complex technology and business growth. Core Expertise: 🚀 Leadership: Managing and coaching teams of 15+ engineers, fostering a culture of accountability and continuous improvement. 🏗️ Architecture: Enterprise Core Systems, Multi-system Integration (ERP/API/ETL), and Core Database Structure. ☁️ Cloud & Scale: AWS Expert; architected systems handling 10B+ monthly requests and managing 100k+ SKUs. 📈 Business Impact: Aligning tech strategy with P&L goals to drive $70k+ in monthly recurring revenue. I thrive on "out-of-the-box" thinking to solve complex technical bottlenecks and am always looking for ways to use automation to improve business productivity. 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 : ) Matthew Jordan Matthew Jordan I've been working at a large software company named Kainos for 2 years, and mainly specialise in Platform Engineering. I regularly enjoy working on software products outside of work, and I'm a huge fan of game development using Unity. I personally enjoy Python & C# in my spare time, but I also specialise in multiple different platform-related technologies from my day job. Victor Denisov Victor Denisov Developer 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.

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