This repository has been archived by the owner on Jan 14, 2021. It is now read-only.
Photon.js not usable with Heroku DB and ZEIT Now V2 due do DB connection limit #289
Labels
Milestone
Note: I'm crossposting a comment from GitHub issue #228 into its own issue so its actionable for engineering. The problem here is based on a stack that many people (especially people starting out) are likely to use:
Currently this stack seems to cause problems in that the connection limit on Heroku's DB is reached very quickly and the only way to resolve is by restarting the server altogether. Note that this might be related to #567 which didn't get resolved but the user switched from Heroku to Google Cloud SQL.
Below is the copy of @ScottAgirs's problem description from #228.
Problem
On some occasions (currently only tested in development (local) environment) Heroku database gets flooded with connections that don't close. On a hobby plan the limit is 20 connections which can be max out in just few interactions with the app and results in a fatal error.
The Error occurs (currently only this case is tested), when creating a new user or logging in.
The Error
Error querying the database: db error: FATAL: too many connections for role
The resolver
resolver.js
:Environment
prisma2@2.0.0-preview015, binary version: 20b6dc13949cccccfef5be07c0be7a3d7c858abe
) deployed to Zeit Now V2Reproduction
Currently have not tried producing more than case in which I get this happens, but the one that shows consistent
Also tried to just wait it out to see if it would close after a while, however, the connections remain active even after prolonged period of time (hours that is).
Solutions?
Currently I need restart the server to fix.
Perhaps there is a function that can explicitly close the connection or something that I've missed?
Fingers crossed for solutions/easy workarounds to this 🤞
The text was updated successfully, but these errors were encountered: