tyler
tyler
Explore posts from servers
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
we get ~1,000 requests per minute, i find it strange that despite this volume prisma is only opening 4 connections (connection_limit=200)
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
"data": {
"getMetrics": {
"counters": [
{
"key": "prisma_client_queries_total",
"labels": {},
"value": 398,
"description": "The total number of Prisma Client queries executed"
},
{
"key": "prisma_datasource_queries_total",
"labels": {},
"value": 1354,
"description": "The total number of datasource queries executed"
},
{
"key": "prisma_pool_connections_closed_total",
"labels": {},
"value": 1,
"description": "The total number of pool connections closed"
},
{
"key": "prisma_pool_connections_opened_total",
"labels": {},
"value": 4,
"description": "The total number of pool connections opened"
}
],
"gauges": [
{
"key": "prisma_client_queries_active",
"labels": {},
"value": 0,
"description": "The number of currently active Prisma Client queries"
},
{
"key": "prisma_client_queries_wait",
"labels": {},
"value": 0,
"description": "The number of datasource queries currently waiting for a free connection"
},
{
"key": "prisma_pool_connections_busy",
"labels": {},
"value": 0,
"description": "The number of pool connections currently executing datasource queries"
},
{
"key": "prisma_pool_connections_idle",
"labels": {},
"value": 3,
"description": "The number of pool connections that are not busy running a query"
},
{
"key": "prisma_pool_connections_open",
"labels": {},
"value": 3,
"description": "The number of pool connections currently open"
}
],
"data": {
"getMetrics": {
"counters": [
{
"key": "prisma_client_queries_total",
"labels": {},
"value": 398,
"description": "The total number of Prisma Client queries executed"
},
{
"key": "prisma_datasource_queries_total",
"labels": {},
"value": 1354,
"description": "The total number of datasource queries executed"
},
{
"key": "prisma_pool_connections_closed_total",
"labels": {},
"value": 1,
"description": "The total number of pool connections closed"
},
{
"key": "prisma_pool_connections_opened_total",
"labels": {},
"value": 4,
"description": "The total number of pool connections opened"
}
],
"gauges": [
{
"key": "prisma_client_queries_active",
"labels": {},
"value": 0,
"description": "The number of currently active Prisma Client queries"
},
{
"key": "prisma_client_queries_wait",
"labels": {},
"value": 0,
"description": "The number of datasource queries currently waiting for a free connection"
},
{
"key": "prisma_pool_connections_busy",
"labels": {},
"value": 0,
"description": "The number of pool connections currently executing datasource queries"
},
{
"key": "prisma_pool_connections_idle",
"labels": {},
"value": 3,
"description": "The number of pool connections that are not busy running a query"
},
{
"key": "prisma_pool_connections_open",
"labels": {},
"value": 3,
"description": "The number of pool connections currently open"
}
],
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
and yes we use a prisma singleton
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
can you advise on the connection_limit when connecting to pgbouncer? setting up metrics now, quick question, if we run Prisma on 3-5 different servers will this return metrics across all or just the application it's being called on
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
we're strongly considering a move off of Prisma at this stage (100k users, social site) because seemingly at random db requests stack up in the queue and take a long time to resolve. it does not correspond to any memory / CPU spike on postgres or application code, at this stage i'm quite confident it's something funky with how prisma handles pooling
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
and with prisma i have ?connection_limit=200&pool_timeout=5
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
here are my pgbouncer settings
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
No description
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
@Nurul (Prisma) the issue is that the prisma seems to be letting idle connections stack up in the queue, I have to manually restart pgbouncer and clear idle connections in postgres to fix it. this happens every few hours
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
No description
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
yes - i generally have 40 - 80 here (just cleared idle connections before i saw this message)
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
does pgbouncer=true handle this somehow? im on pgbouncer 1.22 so it doesn't seem needed
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
the docs are limited
22 replies
PPrisma
Created by tyler on 2/5/2025 in #help-and-questions
PgBouncer and Prisma
would love some help here 🙏
22 replies