graphql icon indicating copy to clipboard operation
graphql copied to clipboard

DB connections get out of hand

Open watzon opened this issue 2 years ago • 2 comments

Dropping this here so I have something to reference while I try to fix the issue, but somewhere between v0.4.0 (tagged in March of 2022) and now a change has been made that seems to cause excessive database connections. Since Postgres is limited to 100 connections by default this causes connection refused errors if it spikes over that amount (which it is in our app).

If I had to guess this is probably related to concurrency changes added around d43a6a129878fbe29068732169b6bca770da08b8.

watzon avatar Jul 28 '23 22:07 watzon

Found the problematic commit:

5ae70e34b072eed3333cb81a82fda8672e3f23bd is the first bad commit
commit 5ae70e34b072eed3333cb81a82fda8672e3f23bd
Author: Joakim Repomaa <[email protected]>
Date:   Sun Oct 16 13:59:07 2022 +0300

    also make array serialization concurrent

 src/graphql/object_type.cr | 52 +++++++++++++++++++++++++++++-----------------
 1 file changed, 33 insertions(+), 19 deletions(-)

watzon avatar Jul 31 '23 20:07 watzon

Nothing in this library creates database connections so I'm not sure what to make of this. How do you create those connections?

jgillich avatar Jul 31 '23 20:07 jgillich