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% + } + } + } + ] } } }