From 6f7d62012ac7f886a5670fa007d55b7f9731bcba Mon Sep 17 00:00:00 2001 From: Andre Kurait Date: Fri, 10 Oct 2025 11:54:27 -0500 Subject: [PATCH] Update RFS default worker config and add initial-lease-duration - Increase default worker CPU from 2048 to 4096 and memory from 4096 to 8192 - Increase default max-connections from 10 to 20 - Add --initial-lease-duration PT60M parameter to RFS command - Update all tests to reflect new default values Signed-off-by: Andre Kurait --- .../reindex-from-snapshot-stack.ts | 9 +++++---- .../test/reindex-from-snapshot-stack.test.ts | 20 +++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/deployment/cdk/opensearch-service-migration/lib/service-stacks/reindex-from-snapshot-stack.ts b/deployment/cdk/opensearch-service-migration/lib/service-stacks/reindex-from-snapshot-stack.ts index f949dfe3da..d269d932b1 100644 --- a/deployment/cdk/opensearch-service-migration/lib/service-stacks/reindex-from-snapshot-stack.ts +++ b/deployment/cdk/opensearch-service-migration/lib/service-stacks/reindex-from-snapshot-stack.ts @@ -90,7 +90,8 @@ export class ReindexFromSnapshotStack extends MigrationServiceCore { command = appendArgIfNotInExtraArgs(command, extraArgsDict, "--lucene-dir", `"${storagePath}/lucene"`) command = appendArgIfNotInExtraArgs(command, extraArgsDict, "--target-host", osClusterEndpoint) command = appendArgIfNotInExtraArgs(command, extraArgsDict, "--max-shard-size-bytes", `${Math.ceil(maxShardSizeBytes)}`) - command = appendArgIfNotInExtraArgs(command, extraArgsDict, "--max-connections", props.reindexFromSnapshotWorkerSize === "maximum" ? "100" : "10") + command = appendArgIfNotInExtraArgs(command, extraArgsDict, "--max-connections", props.reindexFromSnapshotWorkerSize === "maximum" ? "100" : "20") + command = appendArgIfNotInExtraArgs(command, extraArgsDict, "--initial-lease-duration", "PT60M") if (props.clusterAuthDetails.sigv4) { command = appendArgIfNotInExtraArgs(command, extraArgsDict, "--target-aws-service-signing-name", props.clusterAuthDetails.sigv4.serviceSigningName) command = appendArgIfNotInExtraArgs(command, extraArgsDict, "--target-aws-region", props.clusterAuthDetails.sigv4.region) @@ -162,7 +163,7 @@ export class ReindexFromSnapshotStack extends MigrationServiceCore { size: Size.gibibytes(shardVolumeSizeGiB), volumeType: EbsDeviceVolumeType.GP3, fileSystemType: FileSystemType.XFS, - throughput: props.reindexFromSnapshotWorkerSize === "maximum" ? 450 : 125, + throughput: props.reindexFromSnapshotWorkerSize === "maximum" ? 450 : 250, tagSpecifications: [{ tags: { Name: `rfs-snapshot-volume-${props.stage}`, @@ -191,8 +192,8 @@ export class ReindexFromSnapshotStack extends MigrationServiceCore { mountPoints: mountPoints, taskRolePolicies: servicePolicies, cpuArchitecture: props.fargateCpuArch, - taskCpuUnits: props.reindexFromSnapshotWorkerSize === "maximum" ? 16 * 1024 : 2 * 1024, - taskMemoryLimitMiB: props.reindexFromSnapshotWorkerSize === "maximum" ? 32 * 1024 : 4 * 1024, + taskCpuUnits: props.reindexFromSnapshotWorkerSize === "maximum" ? 16 * 1024 : 4 * 1024, + taskMemoryLimitMiB: props.reindexFromSnapshotWorkerSize === "maximum" ? 32 * 1024 : 8 * 1024, ephemeralStorageGiB: ephemeralStorageGiB, environment: { "RFS_COMMAND": command, diff --git a/deployment/cdk/opensearch-service-migration/test/reindex-from-snapshot-stack.test.ts b/deployment/cdk/opensearch-service-migration/test/reindex-from-snapshot-stack.test.ts index 9aef62a8a0..10202ba483 100644 --- a/deployment/cdk/opensearch-service-migration/test/reindex-from-snapshot-stack.test.ts +++ b/deployment/cdk/opensearch-service-migration/test/reindex-from-snapshot-stack.test.ts @@ -74,8 +74,8 @@ describe('ReindexFromSnapshotStack Tests', () => { }); // Assert CPU configuration template.hasResourceProperties('AWS::ECS::TaskDefinition', { - Cpu: "2048", - Memory: "4096", + Cpu: "4096", + Memory: "8192", }); }); @@ -123,7 +123,7 @@ describe('ReindexFromSnapshotStack Tests', () => { { "Ref": "SsmParameterValuemigrationunittestdefaultosClusterEndpointC96584B6F00A464EAD1953AFF4B05118Parameter", }, - " --max-shard-size-bytes 94489280512 --max-connections 10 --source-version \"ES_7.10\"" + " --max-shard-size-bytes 94489280512 --max-connections 20 --initial-lease-duration PT60M --source-version \"ES_7.10\"" ], ], } @@ -181,7 +181,7 @@ describe('ReindexFromSnapshotStack Tests', () => { { "Ref": "SsmParameterValuemigrationunittestdefaultosClusterEndpointC96584B6F00A464EAD1953AFF4B05118Parameter", }, - " --max-shard-size-bytes 94489280512 --max-connections 10 --target-aws-service-signing-name aoss --target-aws-region eu-west-1 --source-version \"ES_7.10\"", + " --max-shard-size-bytes 94489280512 --max-connections 20 --initial-lease-duration PT60M --target-aws-service-signing-name aoss --target-aws-region eu-west-1 --source-version \"ES_7.10\"", ], ], } @@ -243,7 +243,7 @@ describe('ReindexFromSnapshotStack Tests', () => { { "Ref": "SsmParameterValuemigrationunittestdefaultosClusterEndpointC96584B6F00A464EAD1953AFF4B05118Parameter", }, - " --max-shard-size-bytes 94489280512 --max-connections 10 --source-version \"ES_7.10\"" + " --max-shard-size-bytes 94489280512 --max-connections 20 --initial-lease-duration PT60M --source-version \"ES_7.10\"" ], ], } @@ -318,7 +318,7 @@ describe('ReindexFromSnapshotStack Tests', () => { { "Ref": "SsmParameterValuemigrationunittestdefaultosClusterEndpointC96584B6F00A464EAD1953AFF4B05118Parameter", }, - " --max-shard-size-bytes 94489280512 --max-connections 10 --source-version \"ES_7.10\" --custom-arg value --flag --snapshot-name \"custom-snapshot\"" + " --max-shard-size-bytes 94489280512 --max-connections 20 --initial-lease-duration PT60M --source-version \"ES_7.10\" --custom-arg value --flag --snapshot-name \"custom-snapshot\"" ] ] } @@ -372,7 +372,7 @@ describe('ReindexFromSnapshotStack Tests', () => { { "Ref": "SsmParameterValuemigrationunittestdefaultosClusterEndpointC96584B6F00A464EAD1953AFF4B05118Parameter", }, - " --max-shard-size-bytes 94489280512 --max-connections 100 --source-version \"ES_7.10\"", + " --max-shard-size-bytes 94489280512 --max-connections 100 --initial-lease-duration PT60M --source-version \"ES_7.10\"", ], ], } @@ -501,7 +501,7 @@ describe('ReindexFromSnapshotStack Tests', () => { { "Ref": "SsmParameterValuemigrationunittestdefaultosClusterEndpointC96584B6F00A464EAD1953AFF4B05118Parameter", }, - " --max-shard-size-bytes 1181117188 --max-connections 10 --target-aws-service-signing-name aoss --target-aws-region eu-west-1 --source-version \"ES_7.10\"", + " --max-shard-size-bytes 1181117188 --max-connections 20 --initial-lease-duration PT60M --target-aws-service-signing-name aoss --target-aws-region eu-west-1 --source-version \"ES_7.10\"", ], ], } @@ -576,7 +576,7 @@ describe('ReindexFromSnapshotStack Tests', () => { { "Ref": "SsmParameterValuemigrationunittestdefaultosClusterEndpointC96584B6F00A464EAD1953AFF4B05118Parameter", }, - " --max-shard-size-bytes 94489280512 --max-connections 10 --source-version \"ES_7.9\"" + " --max-shard-size-bytes 94489280512 --max-connections 20 --initial-lease-duration PT60M --source-version \"ES_7.9\"" ], ], } @@ -649,4 +649,4 @@ describe('ReindexFromSnapshotStack Tests', () => { // This demonstrates that RFS will fail at runtime with: // "The following option is required: [--source-version, --sourceVersion]" }); -}); \ No newline at end of file +});