ConnectionPooling.constants.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. export const POOLING_OPTIMIZATIONS = {
  6. ci_nano: {
  7. maxClientConn: 200,
  8. poolSize: 15,
  9. },
  10. ci_micro: {
  11. maxClientConn: 200,
  12. poolSize: 15,
  13. },
  14. ci_small: {
  15. maxClientConn: 400,
  16. poolSize: 15,
  17. },
  18. ci_medium: {
  19. maxClientConn: 600,
  20. poolSize: 15,
  21. },
  22. ci_large: {
  23. maxClientConn: 800,
  24. poolSize: 20,
  25. },
  26. ci_xlarge: {
  27. maxClientConn: 1000,
  28. poolSize: 20,
  29. },
  30. ci_2xlarge: {
  31. maxClientConn: 1500,
  32. poolSize: 25,
  33. },
  34. ci_4xlarge: {
  35. maxClientConn: 3000,
  36. poolSize: 32,
  37. },
  38. ci_8xlarge: {
  39. maxClientConn: 6000,
  40. poolSize: 64,
  41. },
  42. ci_12xlarge: {
  43. maxClientConn: 9000,
  44. poolSize: 96,
  45. },
  46. ci_16xlarge: {
  47. maxClientConn: 12000,
  48. poolSize: 128,
  49. },
  50. ci_24xlarge: {
  51. maxClientConn: 18000,
  52. poolSize: 192,
  53. },
  54. ci_24xlarge_optimized_cpu: {
  55. maxClientConn: 18000,
  56. poolSize: 192,
  57. },
  58. ci_24xlarge_optimized_memory: {
  59. maxClientConn: 18000,
  60. poolSize: 192,
  61. },
  62. ci_24xlarge_high_memory: {
  63. maxClientConn: 18000,
  64. poolSize: 192,
  65. },
  66. ci_48xlarge: {
  67. maxClientConn: 36000,
  68. poolSize: 384,
  69. },
  70. ci_48xlarge_optimized_cpu: {
  71. maxClientConn: 36000,
  72. poolSize: 384,
  73. },
  74. ci_48xlarge_optimized_memory: {
  75. maxClientConn: 36000,
  76. poolSize: 384,
  77. },
  78. ci_48xlarge_high_memory: {
  79. maxClientConn: 36000,
  80. poolSize: 384,
  81. },
  82. }