Closed jackwotherspoon closed 2 months ago
Tested this on a local setup with a variation of https://github.com/janpio/21604/tree/main which prints the Prisma metrics. The metrics showcase that indeed more than 1 connection is being created via the connection pool when used with new approach.
When setting connection_limit=3
we can see 3 connections were opened at once...
{
key: 'prisma_pool_connections_opened_total',
labels: {},
value: 3,
description: 'The total number of pool connections opened'
}
The
.startLocalProxy
method of starting a local Unix socket to connect over used.once
which was an oversight. This only allows a single connection via the socket. For a connection pool to leverage several connections at once we should use.on
.Tested using Prisma's
connection_limit
query argument. Using.once
only works withconnection_limit=1
while using.on
allows forconnection_limit=2
etc.Fixes #349