Merged in fix/redis-adjust-batch-settings (pull request #2374)

fix: adjust batch size and remove timeout between delete-calls

* fix: adjust batch size and remove timeout between delete-calls

* chore: adjust scaling


Approved-by: Linus Flood
This commit is contained in:
Joakim Jäderberg
2025-06-17 07:12:44 +00:00
parent 07a764211f
commit de6117f7f7
2 changed files with 6 additions and 8 deletions

View File

@@ -5,8 +5,8 @@ param location string
param containerAppName string param containerAppName string
param containerImage string param containerImage string
param containerPort int param containerPort int
param minReplicas int = environment == 'prod' ? 2 : 1 param minReplicas int = environment == 'prod' ? 5 : 1
param maxReplicas int = 15 param maxReplicas int = 40
param pollingInterval int = 5 param pollingInterval int = 5
param envVars EnvironmentVar[] = [] param envVars EnvironmentVar[] = []
param userAssignedIdentityId string param userAssignedIdentityId string
@@ -76,7 +76,7 @@ resource containerApp 'Microsoft.App/containerApps@2024-10-02-preview' = {
name: 'http-rule' name: 'http-rule'
http: { http: {
metadata: { metadata: {
concurrentRequests: '100' concurrentRequests: '500'
} }
} }
} }
@@ -86,7 +86,7 @@ resource containerApp 'Microsoft.App/containerApps@2024-10-02-preview' = {
type: 'cpu' type: 'cpu'
metadata: { metadata: {
type: 'Utilization' type: 'Utilization'
value: '70' // Trigger scaling if CPU > 70% value: '65' // Trigger scaling if CPU > X%
} }
} }
} }
@@ -96,7 +96,7 @@ resource containerApp 'Microsoft.App/containerApps@2024-10-02-preview' = {
type: 'memory' type: 'memory'
metadata: { metadata: {
type: 'Utilization' type: 'Utilization'
value: '75' // Scale up if memory usage > 75% value: '70' // Scale up if memory usage > X%
} }
} }
} }

View File

@@ -112,7 +112,7 @@ function validateKey(key: string) {
async function deleteWithPattern(pattern: string) { async function deleteWithPattern(pattern: string) {
let cursor = "0"; let cursor = "0";
const SCAN_SIZE = 500; const SCAN_SIZE = 1000;
let totalDeleteCount = 0; let totalDeleteCount = 0;
@@ -134,8 +134,6 @@ async function deleteWithPattern(pattern: string) {
cacheRouteLogger.info(`Deleted ${deleteCount} keys in this batch.`); cacheRouteLogger.info(`Deleted ${deleteCount} keys in this batch.`);
totalDeleteCount += deleteCount; totalDeleteCount += deleteCount;
await timeout(10);
} while (cursor !== "0"); } while (cursor !== "0");
return totalDeleteCount; return totalDeleteCount;