Mohammad Orabi
Mohammad Orabi
Explore posts from servers
PPrisma
Created by Mohammad Orabi on 5/16/2024 in #help-and-questions
Setting Connection limit in gcp cloud run and cloud sql
appreciate your time and help mate thank you very much
20 replies
PPrisma
Created by Mohammad Orabi on 5/16/2024 in #help-and-questions
Setting Connection limit in gcp cloud run and cloud sql
yes all sharing same db user max_client_conn is currently 2000 so if all instances all using the same pool , then we can go with default pool size of 2000 max client connection / 25 max num of instances =80 or we can set it as 400 to be equal to max db connections per database? since all same user and prisma start with 1 and increase ?
20 replies
PPrisma
Created by Mohammad Orabi on 5/16/2024 in #help-and-questions
Setting Connection limit in gcp cloud run and cloud sql
Hello @Jon Harrell sorry for the mention , we just did some config and tests and we think we are so close to a solution we just need 1 extra prisma bit and this is our last question here since its the only prisma related thing sorry and thanks in advance lets say *25 containers each container has a prisma client *pg bouncer has 100 default-pool-size per database , and max-db-connections per database is 400 * what should be the number of connection_limit in the prisma string is it * 100 default pool size /25 num of containers = 4 * or same as default pool so also 100 regardless of containers * or unrelated to default-pool-size , its based on 400 max db -connections /25= 16 * or some other formula
20 replies
PPrisma
Created by Mohammad Orabi on 5/16/2024 in #help-and-questions
Setting Connection limit in gcp cloud run and cloud sql
Okay thank you very much for your time and help
20 replies
PPrisma
Created by Mohammad Orabi on 5/16/2024 in #help-and-questions
Setting Connection limit in gcp cloud run and cloud sql
* latest 5.14 * 0.3.0 * most of the time it starts with the primary then replicas start to also fail "other instances of Prisma Client somewhere" I am only exporting 1 code level but yes in cloud run as serverless , each instance has its own client
20 replies
PPrisma
Created by Mohammad Orabi on 5/16/2024 in #help-and-questions
Setting Connection limit in gcp cloud run and cloud sql
we noticed the master is making writes and reads the replicas are only doing reads
20 replies
PPrisma
Created by Mohammad Orabi on 5/16/2024 in #help-and-questions
Setting Connection limit in gcp cloud run and cloud sql
connected to 1 pg bouncer
20 replies
PPrisma
Created by Mohammad Orabi on 5/16/2024 in #help-and-questions
Setting Connection limit in gcp cloud run and cloud sql
so 3 pg bouncer urls
20 replies
PPrisma
Created by Mohammad Orabi on 5/16/2024 in #help-and-questions
Setting Connection limit in gcp cloud run and cloud sql
yes a list of connection strings , pg bouncers also not directs
20 replies
PPrisma
Created by Mohammad Orabi on 5/16/2024 in #help-and-questions
Setting Connection limit in gcp cloud run and cloud sql
* yes as shown in gcp insights we are max of 10 * via prisma extension
const prisma = new PrismaClient().$extends(
readReplicas({
url: DATABASE_URL_REPLICAS
})
);
const prisma = new PrismaClient().$extends(
readReplicas({
url: DATABASE_URL_REPLICAS
})
);
* no issues shown on pg bouncer , on sql error it is connection to client lost and in prisma cant reach database we are suspecting that mainly our issue is here
20 replies
PPrisma
Created by Mohammad Orabi on 5/16/2024 in #help-and-questions
Setting Connection limit in gcp cloud run and cloud sql
Hello , we are trying to make a correct pg bouncer configuration deployed on a vm to work with cloud run , prisma , and cloud sql postgres * Goal : Handle 2000 concurrent users * Cloud run * max of 10 instances , each instance has a max of 200 concurrent request * Cloud Sql
* master database and 3 replicas , each with a max connection of 500 , total of 2000 together * latest pg bouncer config we are trying * max-client-connection =2000 * default_pool_size= 500. (assuming 2000/4 databases) * max-db-connections 400 (each of our databases can handle 500 max connections) * prisma is using a pgbouncer url with 40 connection_limit , (assuming 500 default pool size / 10 number of instances -10 ) * using load tests we are reaching 500 r/s , created virtual users 829 and started to see errors * prisma errors in application level is " Can't reach database server at pgbouncer ip and port * cloud sql error , connection to client clost we just need some help on how and based on what we should do our numbers , much appreciated ,
20 replies
PPrisma
Created by Mohammad Orabi on 5/16/2024 in #help-and-questions
Setting Connection limit in gcp cloud run and cloud sql
Thank you @Jon Harrell will provide all info in a second
20 replies