File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,12 @@ const connectionString = env.POSTGRES_URL ?? env.DATABASE_URL
1212 * Connection Pool Allocation Strategy
1313 *
1414 * Main App: 25 connections per instance
15- * Socket Server: 3 connections total
15+ * Socket Server: 5 connections (operations) + 2 connections (room manager) = 7 total
1616 *
1717 * With ~3-4 Vercel serverless instances typically active:
1818 * - Main app: 25 × 4 = 100 connections
19- * - Socket server: 3 connections
20- * - Buffer: 25 connections
19+ * - Socket server: 7 connections total
20+ * - Buffer: 21 connections
2121 * - Total: ~128 connections
2222 * - Supabase limit: 128 connections (16XL instance)
2323 */
Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ const connectionString = env.POSTGRES_URL ?? env.DATABASE_URL
1414const socketDb = drizzle (
1515 postgres ( connectionString , {
1616 prepare : false ,
17- idle_timeout : 10 , // Shorter idle timeout for socket operations
18- connect_timeout : 20 , // Increase connection timeout for socket operations
19- max : 2 , // Very small pool for socket server to avoid exhausting Supabase limit
20- onnotice : ( ) => { } , // Disable notices
21- debug : false , // Disable debug for socket operations
17+ idle_timeout : 10 ,
18+ connect_timeout : 20 ,
19+ max : 5 ,
20+ onnotice : ( ) => { } ,
21+ debug : false ,
2222 } ) ,
2323 { schema }
2424)
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ const db = drizzle(
1313 postgres ( connectionString , {
1414 prepare : false ,
1515 idle_timeout : 15 ,
16- connect_timeout : 20 , // Increase connection timeout for room operations
17- max : 1 , // Minimal pool for room operations to conserve connections
16+ connect_timeout : 20 ,
17+ max : 2 ,
1818 onnotice : ( ) => { } ,
1919 } ) ,
2020 { schema }
You can’t perform that action at this time.
0 commit comments