From 4ab58cf3306767b6709589162f6d8172c2d8063d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20J=C3=A4derberg?= Date: Tue, 29 Apr 2025 08:36:51 +0000 Subject: [PATCH] Merged in feature/SW-2531-redis-api-scaling (pull request #1895) Redis-Api: increase max replica count and cpu/memory Approved-by: Linus Flood --- .../redis-api/ci/bicep/app/containerApp.bicep | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/apps/redis-api/ci/bicep/app/containerApp.bicep b/apps/redis-api/ci/bicep/app/containerApp.bicep index b3bc354c3..246bc6c57 100644 --- a/apps/redis-api/ci/bicep/app/containerApp.bicep +++ b/apps/redis-api/ci/bicep/app/containerApp.bicep @@ -5,8 +5,8 @@ param location string param containerAppName string param containerImage string param containerPort int -param minReplicas int = 1 -param maxReplicas int = 3 +param minReplicas int = environment == 'prod' ? 2 : 1 +param maxReplicas int = 15 param envVars EnvironmentVar[] = [] param userAssignedIdentityId string @@ -61,14 +61,45 @@ resource containerApp 'Microsoft.App/containerApps@2024-10-02-preview' = { } ] resources: { - cpu: json('0.25') - memory: '0.5Gi' + cpu: json('0.5') + memory: '1.0Gi' } } ] scale: { minReplicas: minReplicas maxReplicas: maxReplicas + pollingInterval: 15 + rules: [ + { + name: 'http-rule' + http: { + metadata: { + concurrentRequests: '100' + } + } + } + { + name: 'cpu-scaler' + custom: { + type: 'cpu' + metadata: { + type: 'Utilization' + value: '70' // Trigger scaling if CPU > 70% + } + } + } + { + name: 'memory-scaler' + custom: { + type: 'memory' + metadata: { + type: 'Utilization' + value: '75' // Scale up if memory usage > 75% + } + } + } + ] } } }