DB connections get out of hand
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.
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(-)
Nothing in this library creates database connections so I'm not sure what to make of this. How do you create those connections?