Ou I think, I know whats going on. After connectin...
# orm-help
b
Ou I think, I know whats going on. After connecting to db, does Prisma keep connections open and waiting for next request to come in?
b
yeah that make sense, thanks! Btw how does prisma behave if I run 20 queryRaw in Promise.All, would it run them all in parallel if the pool would be big enough right?
Secondly whats relationship between max_connections and pool size? Max connections on postgres tends to be much higher than pool size
n
Yes that’s true, Prisma would run queries in parallel, but if you have connection_pool set to 1 then it would be sequential
Max value in your pool states the number of connections you have set in your pool. In PostgreSQL, max_connections are the number of connections you have set in your database server. So each connection from your pool takes 1 value out from max_connections
b
Why is pool size so much lower than max_connections?
n
You could configure pool size as well as max connections, are you talking about default values?
b
yes, so default values is num_physical_cpus * 2 + 1 which comes down to much less than max_connections
n
pool size would generally be different on case to case basis, so ideally one would always change it as per their traffic and workload, pgbouncer has default of 20 while MySQL has default of 100, so every database provider has different defaults!
b
i see so even num_physical_cpus * 2 + 1 ration depends on case by case and its more like reasonable default
👍 1
n
That’s true!