DiskManagement.constants.tsx 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import { PlanId } from '@/data/subscriptions/types'
  2. // Disk Storage expands automatically when the database reaches 90% of the disk size
  3. export const AUTOSCALING_THRESHOLD = 0.9
  4. export enum DiskType {
  5. GP3 = 'gp3',
  6. IO2 = 'io2',
  7. }
  8. // [Joshen] As per https://github.com/briven/platform/pull/20478
  9. export const DISK_AUTOSCALE_CONFIG_DEFAULTS = {
  10. growthPercent: 50,
  11. minIncrementSize: 4,
  12. maxSizeGb: 60000,
  13. }
  14. export const DISK_PRICING = {
  15. [DiskType.GP3]: {
  16. storage: 0.125, // per GB per month
  17. iops: 0.024, // per IOPS per month, charged after 3000 IOPS
  18. throughput: 0.095, // per MB/s per month, charged after 125 MB/s
  19. },
  20. [DiskType.IO2]: {
  21. storage: 0.195, // per GB per month
  22. iops: 0.119, // per IOPS per month
  23. },
  24. }
  25. export const DISK_LIMITS = {
  26. [DiskType.GP3]: {
  27. minStorage: 1,
  28. maxStorage: 16384,
  29. minIops: 3000,
  30. maxIops: 16000,
  31. minThroughput: 125,
  32. maxThroughput: 1000,
  33. includedIops: 3000,
  34. includedThroughput: 125,
  35. },
  36. [DiskType.IO2]: {
  37. minStorage: 4,
  38. maxStorage: 61440,
  39. minIops: 1500,
  40. maxIops: 256000,
  41. includedIops: 0,
  42. includedThroughput: 0,
  43. },
  44. }
  45. interface PlanDetails {
  46. includedDiskGB: { gp3: number; io2: number }
  47. }
  48. export const PLAN_DETAILS: Record<PlanId, PlanDetails> = {
  49. free: { includedDiskGB: { gp3: 1, io2: 0 } },
  50. pro: { includedDiskGB: { gp3: 8, io2: 0 } },
  51. team: { includedDiskGB: { gp3: 8, io2: 0 } },
  52. enterprise: { includedDiskGB: { gp3: 8, io2: 0 } },
  53. platform: { includedDiskGB: { gp3: 8, io2: 0 } },
  54. }
  55. export const RESTRICTED_COMPUTE_FOR_IOPS_ON_GP3 = ['ci_nano', 'ci_micro', 'ci_small', 'ci_medium']
  56. export const RESTRICTED_COMPUTE_FOR_THROUGHPUT_ON_GP3 = [
  57. 'ci_nano',
  58. 'ci_micro',
  59. 'ci_small',
  60. 'ci_medium',
  61. ]
  62. export const DISK_TYPE_OPTIONS = [
  63. {
  64. type: 'gp3',
  65. name: 'General Purpose SSD',
  66. description: 'Balance between price and performance',
  67. },
  68. {
  69. type: 'io2',
  70. name: 'High Performance SSD',
  71. description: 'High performance for mission critical applications',
  72. },
  73. ]