- To achieve sustained IOPS performance we recommend using the{' '}
+ To achieve higher IOPS performance we recommend using the{' '}
{mapAddOnVariantIdToComputeSize(computeSizeRecommendedForIops)}
{' '}
diff --git a/apps/studio/components/interfaces/DiskManagement/ui/DiskManagement.constants.tsx b/apps/studio/components/interfaces/DiskManagement/ui/DiskManagement.constants.tsx
index b48b48c8bb0..4850a28837d 100644
--- a/apps/studio/components/interfaces/DiskManagement/ui/DiskManagement.constants.tsx
+++ b/apps/studio/components/interfaces/DiskManagement/ui/DiskManagement.constants.tsx
@@ -60,93 +60,6 @@ export const PLAN_DETAILS: Record = {
platform: { includedDiskGB: { gp3: 8, io2: 0 } },
}
-export const COMPUTE_BASELINE_IOPS = {
- ci_nano: 250,
- ci_micro: 500,
- ci_small: 1000,
- ci_medium: 2000,
- ci_large: 3600,
- ci_xlarge: 6000,
- ci_2xlarge: 12000,
- ci_4xlarge: 20000,
- ci_8xlarge: 40000,
- ci_12xlarge: 50000,
- ci_16xlarge: 80000,
- ci_24xlarge: 120000,
- ci_24xlarge_optimized_cpu: 120000,
- ci_24xlarge_optimized_memory: 120000,
- ci_24xlarge_high_memory: 120000,
- ci_48xlarge: 240000,
- ci_48xlarge_optimized_cpu: 240000,
- ci_48xlarge_optimized_memory: 240000,
- ci_48xlarge_high_memory: 240000,
-}
-export const COMPUTE_MAX_IOPS = {
- ci_nano: 11800,
- ci_micro: 11800,
- ci_small: 11800,
- ci_medium: 11800,
- ci_large: 20000,
- ci_xlarge: 20000,
- ci_2xlarge: 20000,
- ci_4xlarge: 20000,
- ci_8xlarge: 40000,
- ci_12xlarge: 50000,
- ci_16xlarge: 80000,
- ci_24xlarge: 120000,
- ci_24xlarge_optimized_cpu: 120000,
- ci_24xlarge_optimized_memory: 120000,
- ci_24xlarge_high_memory: 120000,
- ci_48xlarge: 240000,
- ci_48xlarge_optimized_cpu: 240000,
- ci_48xlarge_optimized_memory: 240000,
- ci_48xlarge_high_memory: 240000,
-}
-
-export const COMPUTE_BASELINE_THROUGHPUT = {
- ci_nano: 43,
- ci_micro: 87,
- ci_small: 174,
- ci_medium: 347,
- ci_large: 630,
- ci_xlarge: 1188,
- ci_2xlarge: 2375,
- ci_4xlarge: 4750,
- ci_8xlarge: 9500,
- ci_12xlarge: 14250,
- ci_16xlarge: 19000,
- ci_24xlarge: 30000,
- ci_24xlarge_optimized_cpu: 30000,
- ci_24xlarge_optimized_memory: 30000,
- ci_24xlarge_high_memory: 30000,
- ci_48xlarge: 40000,
- ci_48xlarge_optimized_cpu: 40000,
- ci_48xlarge_optimized_memory: 40000,
- ci_48xlarge_high_memory: 40000,
-}
-
-export const COMPUTE_MAX_THROUGHPUT = {
- ci_nano: 2085,
- ci_micro: 2085,
- ci_small: 2085,
- ci_medium: 2085,
- ci_large: 4750,
- ci_xlarge: 4750,
- ci_2xlarge: 4750,
- ci_4xlarge: 4750,
- ci_8xlarge: 9500,
- ci_12xlarge: 14250,
- ci_16xlarge: 19000,
- ci_24xlarge: 30000,
- ci_24xlarge_optimized_cpu: 30000,
- ci_24xlarge_optimized_memory: 30000,
- ci_24xlarge_high_memory: 30000,
- ci_48xlarge: 40000,
- ci_48xlarge_optimized_cpu: 40000,
- ci_48xlarge_optimized_memory: 40000,
- ci_48xlarge_high_memory: 40000,
-}
-
export const RESTRICTED_COMPUTE_FOR_IOPS_ON_GP3 = ['ci_nano', 'ci_micro', 'ci_small', 'ci_medium']
export const RESTRICTED_COMPUTE_FOR_THROUGHPUT_ON_GP3 = [
diff --git a/apps/studio/data/config/disk-attributes-update-mutation.ts b/apps/studio/data/config/disk-attributes-update-mutation.ts
index 9a090d9e2a2..bb61a3ebfcc 100644
--- a/apps/studio/data/config/disk-attributes-update-mutation.ts
+++ b/apps/studio/data/config/disk-attributes-update-mutation.ts
@@ -11,7 +11,7 @@ export type UpdateDiskAttributesVariables = {
ref?: string
storageType: 'gp3' | 'io2'
provisionedIOPS: number
- throughput?: number
+ throughput?: number // MB/s
totalSize: number
}
@@ -25,6 +25,8 @@ export async function updateDiskAttributes(updates: UpdateDiskAttributesVariable
updates.storageType === 'gp3'
? {
iops: updates.provisionedIOPS,
+ // API field name is throughput_mbps (legacy), but values are treated as MB/s in the platform API.
+ // If the platform switches to MiB/s, convert here before sending.
throughput_mbps: updates.throughput!,
size_gb: updates.totalSize,
type: updates.storageType,
diff --git a/packages/shared-data/compute-disk-limits.ts b/packages/shared-data/compute-disk-limits.ts
new file mode 100644
index 00000000000..4d5597f4e84
--- /dev/null
+++ b/packages/shared-data/compute-disk-limits.ts
@@ -0,0 +1,180 @@
+import { z } from 'zod'
+
+/**
+ * [Jordi] Use instances.vantage.sh as source of truth for compute disk limits.
+ * Eg: https://instances.vantage.sh/aws/ec2/t4g.nano?currency=USD
+ *
+ * All compute from medium down are t4g and the bigger ones are m6g.
+ *
+ * Throughput values are stored in MB/s (AWS lists Mbps, so we convert with toMBps).
+ */
+
+export type ComputeDiskLimit = {
+ name: string
+ baselineIops: number
+ maxIops: number
+ baselineThroughputMBps: number
+ maxThroughputMBps: number
+}
+
+const toMBps = (throughputMbps: number) => Math.round(throughputMbps / 8)
+
+export const COMPUTE_DISK = {
+ ci_nano: {
+ name: 'Nano (free)',
+ baselineIops: 250,
+ maxIops: 11800,
+ baselineThroughputMBps: toMBps(43),
+ maxThroughputMBps: toMBps(2085),
+ },
+ ci_micro: {
+ name: 'Micro',
+ baselineIops: 500,
+ maxIops: 11800,
+ baselineThroughputMBps: toMBps(87),
+ maxThroughputMBps: toMBps(2085),
+ },
+ ci_small: {
+ name: 'Small',
+ baselineIops: 1000,
+ maxIops: 11800,
+ baselineThroughputMBps: toMBps(174),
+ maxThroughputMBps: toMBps(2085),
+ },
+ ci_medium: {
+ name: 'Medium',
+ baselineIops: 2000,
+ maxIops: 11800,
+ baselineThroughputMBps: toMBps(347),
+ maxThroughputMBps: toMBps(2085),
+ },
+ ci_large: {
+ name: 'Large',
+ baselineIops: 3600,
+ maxIops: 20000,
+ baselineThroughputMBps: toMBps(630),
+ maxThroughputMBps: toMBps(4750),
+ },
+ ci_xlarge: {
+ name: 'XL',
+ baselineIops: 6000,
+ maxIops: 20000,
+ baselineThroughputMBps: toMBps(1188),
+ maxThroughputMBps: toMBps(4750),
+ },
+ ci_2xlarge: {
+ name: '2XL',
+ baselineIops: 12000,
+ maxIops: 20000,
+ baselineThroughputMBps: toMBps(2375),
+ maxThroughputMBps: toMBps(4750),
+ },
+ ci_4xlarge: {
+ name: '4XL',
+ baselineIops: 20000,
+ maxIops: 20000,
+ baselineThroughputMBps: toMBps(4750),
+ maxThroughputMBps: toMBps(4750),
+ },
+ ci_8xlarge: {
+ name: '8XL',
+ baselineIops: 40000,
+ maxIops: 40000,
+ baselineThroughputMBps: toMBps(9500),
+ maxThroughputMBps: toMBps(9500),
+ },
+ ci_12xlarge: {
+ name: '12XL',
+ baselineIops: 50000,
+ maxIops: 50000,
+ baselineThroughputMBps: toMBps(14250),
+ maxThroughputMBps: toMBps(14250),
+ },
+ ci_16xlarge: {
+ name: '16XL',
+ baselineIops: 80000,
+ maxIops: 80000,
+ baselineThroughputMBps: toMBps(19000),
+ maxThroughputMBps: toMBps(19000),
+ },
+ ci_24xlarge: {
+ name: '24XL',
+ baselineIops: 120000,
+ maxIops: 120000,
+ baselineThroughputMBps: toMBps(30000),
+ maxThroughputMBps: toMBps(30000),
+ },
+ ci_24xlarge_optimized_cpu: {
+ name: '24XL - Optimized CPU',
+ baselineIops: 120000,
+ maxIops: 120000,
+ baselineThroughputMBps: toMBps(30000),
+ maxThroughputMBps: toMBps(30000),
+ },
+ ci_24xlarge_optimized_memory: {
+ name: '24XL - Optimized Memory',
+ baselineIops: 120000,
+ maxIops: 120000,
+ baselineThroughputMBps: toMBps(30000),
+ maxThroughputMBps: toMBps(30000),
+ },
+ ci_24xlarge_high_memory: {
+ name: '24XL - High Memory',
+ baselineIops: 120000,
+ maxIops: 120000,
+ baselineThroughputMBps: toMBps(30000),
+ maxThroughputMBps: toMBps(30000),
+ },
+ ci_48xlarge: {
+ name: '48XL',
+ baselineIops: 240000,
+ maxIops: 240000,
+ baselineThroughputMBps: toMBps(40000),
+ maxThroughputMBps: toMBps(40000),
+ },
+ ci_48xlarge_optimized_cpu: {
+ name: '48XL - Optimized CPU',
+ baselineIops: 240000,
+ maxIops: 240000,
+ baselineThroughputMBps: toMBps(40000),
+ maxThroughputMBps: toMBps(40000),
+ },
+ ci_48xlarge_optimized_memory: {
+ name: '48XL - Optimized Memory',
+ baselineIops: 240000,
+ maxIops: 240000,
+ baselineThroughputMBps: toMBps(40000),
+ maxThroughputMBps: toMBps(40000),
+ },
+ ci_48xlarge_high_memory: {
+ name: '48XL - High Memory',
+ baselineIops: 240000,
+ maxIops: 240000,
+ baselineThroughputMBps: toMBps(40000),
+ maxThroughputMBps: toMBps(40000),
+ },
+} as const satisfies Record
+
+export type ComputeDiskKey = keyof typeof COMPUTE_DISK
+
+export const COMPUTE_BASELINE_IOPS = Object.fromEntries(
+ Object.entries(COMPUTE_DISK).map(([key, value]) => [key, value.baselineIops])
+)
+
+export const COMPUTE_MAX_IOPS = Object.fromEntries(
+ Object.entries(COMPUTE_DISK).map(([key, value]) => [key, value.maxIops])
+)
+
+export const COMPUTE_BASELINE_THROUGHPUT = Object.fromEntries(
+ Object.entries(COMPUTE_DISK).map(([key, value]) => [key, value.baselineThroughputMBps])
+)
+
+export const COMPUTE_MAX_THROUGHPUT = Object.fromEntries(
+ Object.entries(COMPUTE_DISK).map(([key, value]) => [key, value.maxThroughputMBps])
+)
+
+const computeInstanceAddonVariantIds = Object.keys(COMPUTE_DISK) as ComputeDiskKey[]
+
+export const computeInstanceAddonVariantIdSchema = z.enum(
+ computeInstanceAddonVariantIds as [ComputeDiskKey, ...ComputeDiskKey[]]
+)
diff --git a/packages/shared-data/index.ts b/packages/shared-data/index.ts
index 9f334c453e8..c1af4621d10 100644
--- a/packages/shared-data/index.ts
+++ b/packages/shared-data/index.ts
@@ -1,4 +1,12 @@
import config from './config'
+import {
+ COMPUTE_BASELINE_IOPS,
+ COMPUTE_BASELINE_THROUGHPUT,
+ COMPUTE_DISK,
+ COMPUTE_MAX_IOPS,
+ COMPUTE_MAX_THROUGHPUT,
+ computeInstanceAddonVariantIdSchema,
+} from './compute-disk-limits'
import extensions from './extensions.json'
import logConstants from './logConstants'
import { plans, PricingInformation } from './plans'
@@ -11,6 +19,12 @@ import tweets, { topTweets } from './tweets'
export {
AWS_REGIONS,
+ COMPUTE_BASELINE_IOPS,
+ COMPUTE_BASELINE_THROUGHPUT,
+ COMPUTE_DISK,
+ COMPUTE_MAX_IOPS,
+ COMPUTE_MAX_THROUGHPUT,
+ computeInstanceAddonVariantIdSchema,
config,
extensions,
FLY_REGIONS,
diff --git a/packages/shared-data/package.json b/packages/shared-data/package.json
index 9aacccfae9e..2f94d2e9323 100644
--- a/packages/shared-data/package.json
+++ b/packages/shared-data/package.json
@@ -12,5 +12,8 @@
"tsconfig": "workspace:"
},
"author": "",
- "license": "MIT"
+ "license": "MIT",
+ "dependencies": {
+ "zod": "catalog:"
+ }
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index aa8623e41db..64603779563 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -61,7 +61,7 @@ catalogs:
specifier: ^3.2.0
version: 3.2.4
zod:
- specifier: ^3.25.76
+ specifier: 3.25.76
version: 3.25.76
overrides:
@@ -2257,6 +2257,10 @@ importers:
version: 3.2.4(@types/node@22.13.14)(@vitest/ui@3.2.4)(jiti@2.5.1)(jsdom@20.0.3(supports-color@8.1.1))(msw@2.11.3(@types/node@22.13.14)(typescript@5.9.2))(sass@1.77.4)(supports-color@8.1.1)(terser@5.39.0)(tsx@4.20.3)(yaml@2.8.1)
packages/shared-data:
+ dependencies:
+ zod:
+ specifier: 'catalog:'
+ version: 3.25.76
devDependencies:
tsconfig:
specifier: 'workspace:'
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 058cc24dc7f..408e1a88026 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -25,7 +25,7 @@ catalog:
valtio: ^1.12.0
vite: ^7.1.11
vitest: ^3.2.0
- zod: ^3.25.76
+ zod: 3.25.76
ignoredBuiltDependencies:
- '@parcel/watcher'