Skip to content

Commit 705ac02

Browse files
feat: Serve 10% of tag-page-rendering PROD traffic with ECS (#16746)
* refactor: Make target weighting configurable This is a no-op change. Co-authored-by: connoromalleyatwork <connoromalleyatwork@users.noreply.github.com> * feat: Route 100% of traffic for tag-page-rendering CODE to ECS We have performed a number of load tests against CODE and are happy with it's performance compared to EC2. Co-authored-by: connoromalleyatwork <connoromalleyatwork@users.noreply.github.com> * feat: Serve 10% of tag-page-rendering PROD traffic with ECS After load testing, we're confident that ECS can serve production traffic. 10% equates to 70-100 requests/minute. Co-authored-by: connoromalleyatwork <connoromalleyatwork@users.noreply.github.com> --------- Co-authored-by: connoromalleyatwork <connoromalleyatwork@users.noreply.github.com>
1 parent 06b619a commit 705ac02

3 files changed

Lines changed: 21 additions & 10 deletions

File tree

dotcom-rendering/cdk/bin/cdk.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ export const TagPageRenderingPropsCODE: RenderingCDKStackProps = {
124124
scaleOutCooldown: Duration.seconds(60),
125125
},
126126
},
127+
128+
// Route all traffic to ECS
129+
targetGroupWeights: {
130+
ec2: 0,
131+
ecs: 1,
132+
},
127133
},
128134
};
129135

@@ -178,6 +184,12 @@ export const TagPageRenderingPropsPROD: RenderingCDKStackProps = {
178184
scaleOutCooldown: Duration.seconds(60),
179185
},
180186
},
187+
188+
// Route 90% traffic to EC2, 10% to ECS
189+
targetGroupWeights: {
190+
ec2: 9,
191+
ecs: 1,
192+
},
181193
},
182194
};
183195

dotcom-rendering/cdk/lib/__snapshots__/renderingStack.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,13 +2966,13 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering CODE
29662966
"TargetGroupArn": {
29672967
"Ref": "TargetGroupTagpagerendering42E428EE",
29682968
},
2969-
"Weight": 1,
2969+
"Weight": 0,
29702970
},
29712971
{
29722972
"TargetGroupArn": {
29732973
"Ref": "TagpagerenderingEcsTargetGroupTagpagerendering0976D2E5",
29742974
},
2975-
"Weight": 0,
2975+
"Weight": 1,
29762976
},
29772977
],
29782978
},
@@ -5459,13 +5459,13 @@ exports[`The RenderingCDKStack matches the snapshot for Tag Page Rendering PROD
54595459
"TargetGroupArn": {
54605460
"Ref": "TargetGroupTagpagerendering42E428EE",
54615461
},
5462-
"Weight": 1,
5462+
"Weight": 9,
54635463
},
54645464
{
54655465
"TargetGroupArn": {
54665466
"Ref": "TagpagerenderingEcsTargetGroupTagpagerendering0976D2E5",
54675467
},
5468-
"Weight": 0,
5468+
"Weight": 1,
54695469
},
54705470
],
54715471
},

dotcom-rendering/cdk/lib/renderingStack.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ export interface RenderingCDKStackProps extends Omit<GuStackProps, 'stack'> {
7272
scaling: NonNullable<
7373
GuLoadBalancedAppExperimentalProps['ecsProps']
7474
>['scaling'];
75+
76+
targetGroupWeights: NonNullable<
77+
GuLoadBalancedAppExperimentalProps['targetGroupWeights']
78+
>;
7579
};
7680
}
7781

@@ -303,12 +307,7 @@ export class RenderingCDKStack extends CDKStack {
303307
cpu: ecsProps.taskCpu,
304308
scaling: ecsProps.scaling,
305309
},
306-
307-
// Route all traffic to EC2
308-
targetGroupWeights: {
309-
ec2: 1,
310-
ecs: 0,
311-
},
310+
targetGroupWeights: ecsProps.targetGroupWeights,
312311
}),
313312
});
314313

0 commit comments

Comments
 (0)