ConnectionPooling.constants.ts83 lines · main
1// https://supabase.com/docs/guides/platform/performance#optimizing-the-number-of-connections
2// https://github.com/briven/platform/blob/develop/worker/src/lib/constants.ts#L544-L596
3// https://github.com/briven/briven-admin-api/blob/master/optimizations/pgbouncer.go
4// [Joshen] This matches for both Supavisor and PgBouncer
5
6export const POOLING_OPTIMIZATIONS = {
7 ci_nano: {
8 maxClientConn: 200,
9 poolSize: 15,
10 },
11 ci_micro: {
12 maxClientConn: 200,
13 poolSize: 15,
14 },
15 ci_small: {
16 maxClientConn: 400,
17 poolSize: 15,
18 },
19 ci_medium: {
20 maxClientConn: 600,
21 poolSize: 15,
22 },
23 ci_large: {
24 maxClientConn: 800,
25 poolSize: 20,
26 },
27 ci_xlarge: {
28 maxClientConn: 1000,
29 poolSize: 20,
30 },
31 ci_2xlarge: {
32 maxClientConn: 1500,
33 poolSize: 25,
34 },
35 ci_4xlarge: {
36 maxClientConn: 3000,
37 poolSize: 32,
38 },
39 ci_8xlarge: {
40 maxClientConn: 6000,
41 poolSize: 64,
42 },
43 ci_12xlarge: {
44 maxClientConn: 9000,
45 poolSize: 96,
46 },
47 ci_16xlarge: {
48 maxClientConn: 12000,
49 poolSize: 128,
50 },
51 ci_24xlarge: {
52 maxClientConn: 18000,
53 poolSize: 192,
54 },
55 ci_24xlarge_optimized_cpu: {
56 maxClientConn: 18000,
57 poolSize: 192,
58 },
59 ci_24xlarge_optimized_memory: {
60 maxClientConn: 18000,
61 poolSize: 192,
62 },
63 ci_24xlarge_high_memory: {
64 maxClientConn: 18000,
65 poolSize: 192,
66 },
67 ci_48xlarge: {
68 maxClientConn: 36000,
69 poolSize: 384,
70 },
71 ci_48xlarge_optimized_cpu: {
72 maxClientConn: 36000,
73 poolSize: 384,
74 },
75 ci_48xlarge_optimized_memory: {
76 maxClientConn: 36000,
77 poolSize: 384,
78 },
79 ci_48xlarge_high_memory: {
80 maxClientConn: 36000,
81 poolSize: 384,
82 },
83}