NeonN
Neon8mo ago
10 replies
primary-violet

Db connections are not removed when established from aws lambda

Hi team, we are running in aws lambdas and setting up a connection like this:
  const pool = new Pool({
    connectionString: ...,
    connectionTimeoutMillis: 10000, // connection timeout in milliseconds
    idleTimeoutMillis: 10000, // idle timeout in milliseconds
  });
  const db = drizzle(pool, { schema: { ...schema, ...relations } });


This db is reused between invocations in lambda. Current executions never get above 25 in aws, and there's concurrency limits set on that, however in neon dashboard it's seen the db connection count approaches 100. how is that possible? Is there a way to counteract this?
Screenshot_2025-05-18_at_13.25.22.png
Was this page helpful?