Darryl
02/04/2021, 9:19 AM2.15.0
as nothing else has changed. When I say issues, I mean things are either way slower than they normally are or they just don't work at all. Logging in, fetching products, etc. Stuff that's worked without issue for a few months now.
I'm using Sentry and one of the recent issues shown from a client was:
Error: GraphQL error: Error in connector: Error creating a database connection. (Timed out fetching a connection from the pool (connection limit: 3, in use: 0))
GraphQL error: Error in connector: Error creating a database connection. (Timed out fetching a c...
I've had this setup for a few months, updating the odd thing on the server every now and then, and it's been stable while I've been focusing on the client. Based off that error message alone, can anyone see if I've maybe missed something with the latest Prisma update or if there's anything else you recommend. Thanks! 🙂Dominic Hadfield
02/04/2021, 9:27 AMDarryl
02/04/2021, 9:29 AM2.16.0
but I use nexus-plugin-prisma
and that's not been updated.Dominic Hadfield
02/04/2021, 9:33 AMDarryl
02/04/2021, 9:43 AMIf theIn my case then, testing on a $5 Droplet with one vCPU, I wonder how many connections were automatically calculated as I haven't specified an amount myself. 🤔 To be honest, I don't know much about this kind of thing.argument is omitted, the default number of connections is calculated according to this formula:connection_limit
wherenum_physical_cpus * 2 + 1
represents the number of physical CPUs on your machine.num_physical_cpus
Dominic Hadfield
02/04/2021, 9:43 AMDominic Hadfield
02/04/2021, 9:49 AMDarryl
02/04/2021, 9:52 AMnikolasburk
Dominic Hadfield
02/04/2021, 10:59 AMDarryl
02/04/2021, 10:59 AMDaniel Norman
max_connections
config of your PostgreSQL instance?
You can check that with the SHOW config_file;
in the psql
CLI.Darryl
02/04/2021, 11:15 AMDarryl
02/04/2021, 11:34 AMSHOW max_connections;
and I see:
max_connections
-----------------
500
(1 row)
Daniel Norman
20
. The max_connections
you got from PostgreSQL probably applies to the whole database instance.
My hunch is that this is related to the latency between the DO droplet and the hobby Heroku DB. Because the hobby Heroku DBs use multi-tenancy their performance is very flaky.
Either way, this is also related to Prisma’s connection pool and its timeout configuration which we are investigating.
Could you try out setting pool_timeout=0
in the DB connection string? This will ensure that there’s no timeout at all.
In 2.15.0 we introduced a change that sets it to a default of 5 seconds. So it might be related.Darryl
02/04/2021, 11:53 AMnikolasburk
Dominic Hadfield
02/09/2021, 8:33 AM