connection_reusedDatabase connection reused from pool
Connection pooling is working effectively, avoiding costly connection establishment overhead.
What this signal means
typescript
// connection_reused fires when your pool hands out an existing connection
// rather than opening a new TCP connection to the database.
//
// New connection: TCP handshake + TLS + auth = 20–100ms overhead
// Reused connection: 0ms overhead
//
// Configure your pool size to maximise reuse under your concurrency:
// Prisma
const prisma = new PrismaClient({
datasources: {
db: { url: process.env.DATABASE_URL + '?connection_limit=10&pool_timeout=5' },
},
});
// Mongoose
mongoose.connect(uri, {
maxPoolSize: 10, // max concurrent connections
minPoolSize: 2, // keep warm connections alive
socketTimeoutMS: 30_000,
});