paradedb / pg_analytics

DuckDB-powered analytics for Postgres
https://paradedb.com
PostgreSQL License
197 stars 13 forks source link

feat: Eviction policy for managing maximum connections #38

Closed vaibhawvipul closed 2 months ago

vaibhawvipul commented 2 months ago

Ticket(s) Closed

What

Why

Making feat/cache prod ready

How

  1. Postgres shared memory cannot be dynamically resized. As a result, we’ve arbitrary set the maximum allowed number of DuckDB connections to 128. If more than 128 connections are created, connections are created but discarded immediately after they’re used. We should consider if this is the optimal behavior.

  2. DuckDB connections are wrapped inside a Mutex because LwLock requires that what’s inside of it implements Sync. We should make sure that the mutex lock is released if a Postgres backend process segfaults while the lock is being held.

Tests