diff --git a/apps/studio/components/interfaces/DiskManagement/DiskManagement.utils.ts b/apps/studio/components/interfaces/DiskManagement/DiskManagement.utils.ts index 7ac8190e36d..fb75a3eb5f3 100644 --- a/apps/studio/components/interfaces/DiskManagement/DiskManagement.utils.ts +++ b/apps/studio/components/interfaces/DiskManagement/DiskManagement.utils.ts @@ -191,17 +191,17 @@ export function getAvailableComputeOptions(availableAddons: any[], projectCloudP export const calculateMaxIopsAllowedForDiskSizeWithGp3 = (totalSize: number) => { if (!totalSize) throw Error('Total size is required') - return Math.min(1000 * totalSize, 256000) + return Math.min(3000 * totalSize, 16000) } export const calculateDiskSizeRequiredForIopsWithGp3 = (iops: number) => { if (!iops) throw Error('IOPS is required') - return Math.max(1, Math.ceil(iops / 1000)) + return Math.max(1, Math.ceil(iops / 3000)) } export const calculateMaxIopsAllowedForDiskSizeWithio2 = (totalSize: number) => { if (!totalSize) throw Error('Total size is required') - return Math.min(500 * totalSize, 16000) + return Math.min(500 * totalSize, 256000) } export const calculateDiskSizeRequiredForIopsWithIo2 = (iops: number) => { diff --git a/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx b/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx index 7f6bb5cf311..c74e84418ee 100644 --- a/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx +++ b/apps/studio/components/interfaces/DiskManagement/DiskManagementForm.tsx @@ -257,33 +257,10 @@ export function DiskManagementForm() { const disableIopsInput = RESTRICTED_COMPUTE_FOR_IOPS_ON_GP3.includes(watchedComputeSize) && watchedStorageType === 'gp3' - const disableThroughputInput = - RESTRICTED_COMPUTE_FOR_THROUGHPUT_ON_GP3.includes(watchedComputeSize) && - watchedStorageType === 'gp3' - - const currentCompute = (addons?.selected_addons ?? []).find((x) => x.type === 'compute_instance') - ?.variant - const maxIopsBasedOnCompute = - COMPUTE_MAX_IOPS[watchedComputeSize as keyof typeof COMPUTE_MAX_IOPS] - const maxThroughputBasedOnCompute = - COMPUTE_MAX_THROUGHPUT[watchedComputeSize as keyof typeof COMPUTE_MAX_THROUGHPUT] - const { includedDiskGB: includedDiskGBMeta } = PLAN_DETAILS?.[planId as keyof typeof PLAN_DETAILS] ?? {} const includedDiskGB = includedDiskGBMeta[watchedStorageType] - const minIOPS = IOPS_RANGE[watchedStorageType]?.min ?? 0 - const maxIOPS = - watchedStorageType === 'gp3' - ? Math.min(500 * watchedTotalSize, IOPS_RANGE[DiskType.GP3].max) - : Math.min(1000 * watchedTotalSize, IOPS_RANGE[DiskType.IO2].max) - const minThroughput = - watchedStorageType === 'gp3' ? THROUGHPUT_RANGE[watchedStorageType]?.min ?? 0 : 0 - const maxThroughput = - watchedStorageType === 'gp3' - ? Math.min(0.25 * watchedIOPS, THROUGHPUT_RANGE[DiskType.GP3].max) - : undefined - /** * Price calculations */ @@ -666,6 +643,8 @@ export function DiskManagementForm() { // only trigger provisionedIOPS due to other input being hidden await form.trigger('provisionedIOPS') await form.trigger('totalSize') + + trigger('provisionedIOPS') }} defaultValue={field.value} disabled={disableInput}