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 @@ -11,22 +11,22 @@ const connectionString = env.POSTGRES_URL ?? env.DATABASE_URL
1111/**
1212 * Connection Pool Allocation Strategy
1313 *
14- * Main App: 25 connections per instance
15- * Socket Server: 5 connections (operations) + 2 connections (room manager) = 7 total
14+ * Main App: 60 connections per instance
15+ * Socket Server: 25 connections (operations) + 5 connections (room manager) = 30 total
1616 *
1717 * With ~3-4 Vercel serverless instances typically active:
18- * - Main app: 25 × 4 = 100 connections
19- * - Socket server: 7 connections total
20- * - Buffer: 21 connections
21- * - Total: ~128 connections
22- * - Supabase limit: 128 connections (16XL instance)
18+ * - Main app: 60 × 4 = 240 connections
19+ * - Socket server: 30 connections total
20+ * - Buffer: 130 connections
21+ * - Total: ~400 connections
22+ * - Supabase limit: 400 connections (16XL instance direct connection pool )
2323 */
2424
2525const postgresClient = postgres ( connectionString , {
2626 prepare : false ,
2727 idle_timeout : 20 ,
2828 connect_timeout : 30 ,
29- max : 25 ,
29+ max : 60 ,
3030 onnotice : ( ) => { } ,
3131} )
3232
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const socketDb = drizzle(
1616 prepare : false ,
1717 idle_timeout : 10 ,
1818 connect_timeout : 20 ,
19- max : 5 ,
19+ max : 25 ,
2020 onnotice : ( ) => { } ,
2121 debug : false ,
2222 } ) ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ const db = drizzle(
1414 prepare : false ,
1515 idle_timeout : 15 ,
1616 connect_timeout : 20 ,
17- max : 2 ,
17+ max : 5 ,
1818 onnotice : ( ) => { } ,
1919 } ) ,
2020 { schema }
You can’t perform that action at this time.
0 commit comments