Skip to content

chore: always run the maximum amount of usage services#7924

Merged
n1ru4l merged 1 commit intomainfrom
chore-fixed-amount-of-usage-collectors
Mar 27, 2026
Merged

chore: always run the maximum amount of usage services#7924
n1ru4l merged 1 commit intomainfrom
chore-fixed-amount-of-usage-collectors

Conversation

@n1ru4l
Copy link
Copy Markdown
Contributor

@n1ru4l n1ru4l commented Mar 27, 2026

We are not scaling nodes, so I see no need to scale individual pods if we have the resources anyways.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The usageService replica count for production and staging environments was increased to 6. To improve maintainability and prevent configuration drift, the replicas and maxReplicas values should be linked using a shared constant.

Comment on lines +63 to 65
replicas: isProduction || isStaging ? 6 : 1,
cpuLimit: isProduction ? '1000m' : '100m',
maxReplicas: isProduction || isStaging ? 6 : 1,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While this change correctly sets the initial number of replicas to match the maximum, it introduces a maintenance concern because the values for replicas and maxReplicas are now identical but not programmatically linked.

If maxReplicas is changed in the future, replicas would also need to be updated manually to ensure the service continues to run at its maximum capacity, as intended. Forgetting to do so would re-introduce auto-scaling.

To make this more robust and prevent configuration drift, consider defining a constant for the replica count and using it for both properties.

const usageServiceReplicas = isProduction || isStaging ? 6 : 1;

usageService: {
  replicas: usageServiceReplicas,
  cpuLimit: isProduction ? '1000m' : '100m',
  maxReplicas: usageServiceReplicas,
  cpuAverageToScale: 60,
}

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tag: 55fafcd482a177f4f874310cbb13012492a65abc

@n1ru4l n1ru4l marked this pull request as ready for review March 27, 2026 12:17
@n1ru4l n1ru4l merged commit 883e0bc into main Mar 27, 2026
24 of 25 checks passed
@n1ru4l n1ru4l deleted the chore-fixed-amount-of-usage-collectors branch March 27, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant