Skip to content

Commit

Permalink
Merge pull request #339 from metaDAOproject/fix/connection-overload
Browse files Browse the repository at this point in the history
fix: reduce the overhead
  • Loading branch information
R-K-H authored Dec 16, 2024
2 parents 2ac6a81 + f86b768 commit 639ca24
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/database/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ const ACQUIRE_TIMEOUT = 10000; // 10 second timeout for acquiring connection
// Add connection pool configuration
const poolConfig = {
connectionString: connectionString,
min: 20,
max: 1000,
idleTimeoutMillis: 30 * 1000,
connectionTimeoutMillis: 5000,
min: 3,
max: 300, // Reduced from 1000 to a more reasonable number
idleTimeoutMillis: 5 * 1000,
connectionTimeoutMillis: 5 * 1000,
acquireTimeoutMillis: 60 * 1000,
evictionRunIntervalMillis: 1000,
// Add error handling for the pool
async errorHandler(err: Error) {
console.error('Pool error:', err);
Expand Down

0 comments on commit 639ca24

Please sign in to comment.