mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
improvement(db): further increase db limits (#696)
* increase sockets connection pool * correct comment * increase limits * remove comments
This commit is contained in:
committed by
GitHub
parent
fd96e446ae
commit
2d83bbf769
@@ -11,22 +11,22 @@ const connectionString = env.POSTGRES_URL ?? env.DATABASE_URL
|
||||
/**
|
||||
* Connection Pool Allocation Strategy
|
||||
*
|
||||
* Main App: 25 connections per instance
|
||||
* Socket Server: 5 connections (operations) + 2 connections (room manager) = 7 total
|
||||
* Main App: 60 connections per instance
|
||||
* Socket Server: 25 connections (operations) + 5 connections (room manager) = 30 total
|
||||
*
|
||||
* With ~3-4 Vercel serverless instances typically active:
|
||||
* - Main app: 25 × 4 = 100 connections
|
||||
* - Socket server: 7 connections total
|
||||
* - Buffer: 21 connections
|
||||
* - Total: ~128 connections
|
||||
* - Supabase limit: 128 connections (16XL instance)
|
||||
* - Main app: 60 × 4 = 240 connections
|
||||
* - Socket server: 30 connections total
|
||||
* - Buffer: 130 connections
|
||||
* - Total: ~400 connections
|
||||
* - Supabase limit: 400 connections (16XL instance direct connection pool)
|
||||
*/
|
||||
|
||||
const postgresClient = postgres(connectionString, {
|
||||
prepare: false,
|
||||
idle_timeout: 20,
|
||||
connect_timeout: 30,
|
||||
max: 25,
|
||||
max: 60,
|
||||
onnotice: () => {},
|
||||
})
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ const socketDb = drizzle(
|
||||
prepare: false,
|
||||
idle_timeout: 10,
|
||||
connect_timeout: 20,
|
||||
max: 5,
|
||||
max: 25,
|
||||
onnotice: () => {},
|
||||
debug: false,
|
||||
}),
|
||||
|
||||
@@ -14,7 +14,7 @@ const db = drizzle(
|
||||
prepare: false,
|
||||
idle_timeout: 15,
|
||||
connect_timeout: 20,
|
||||
max: 2,
|
||||
max: 5,
|
||||
onnotice: () => {},
|
||||
}),
|
||||
{ schema }
|
||||
|
||||
Reference in New Issue
Block a user