Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add app param to ignore manual replica count scaling #3737

Closed
wants to merge 1 commit into from

Conversation

nightfury1204
Copy link
Collaborator

@nightfury1204 nightfury1204 commented Aug 8, 2024

What is the feature/update/fix?

Feature: Added App Parameter to Ignore Manual Desired Count Scaling

We have introduced a new app parameter, IgnoreManualScaleCount, which allows you to control whether manually set desired counts are ignored when autoscaling is enabled. This parameter can be set to Yes or No, with the default being No.

Why is this important?

When autoscaling is enabled with targets configured in the convox.yml file, services will scale based on those targets. The desired count is defined in the scale section of convox.yml. If the scale specifies a range, the desired count defaults to the lower end of the range, which represents the minimum count the service should maintain.

For example, with the following configuration, the desired count is set to 4 by default:

services:
  web:
    scale:
      count: 4-10
      targets:
        cpu: 70
        memory: 90
        requests: 200

In this configuration, the service will maintain a minimum of 4 instances and can scale up to 10 based on the specified targets (CPU, memory, and requests).

If you manually scale a service using:

$ convox scale serviceName --count <number> -a appName

This command sets a new desired count. The service will temporarily adjust to this manually set count, but as the autoscaler monitors the target metrics, it may adjust the active count again based on those targets. This manually set desired count will persist through redeployments, overriding any count set in the convox.yml file.

By setting IgnoreManualScaleCount to Yes, the desired count from convox.yml will not be considered, and the autoscaler will maintain the active count dynamically, persisting even through redeployments. This is particularly useful in environments where you want the service count to be fully managed by the autoscaler without manual interventions resetting the desired state.

How to use it?

  1. Set the IgnoreManualScaleCount parameter to Yes or No:

    $ convox apps params set -a appName IgnoreManualScaleCount=Yes
    
  2. Verify that the parameter is set:

    $ convox apps params -a appName
    

    This command will display the current app parameters, confirming that IgnoreManualScaleCount is set correctly.

  3. Check the Desired Count and Scaling Configuration:
    You can check the desired count using:

    $ convox scale -a appName
    

    This will display the current scaling configuration and counts for your services.

Does it have a breaking change?

There are no breaking changes introduced with this feature.

Requirements

To use this feature, you must be on at least rack version 20240809110958.
You can check your rack's version with the command convox rack -r rackName.
Update your rack to the latest version with the command convox rack update -r rackName.

nightfury1204 added a commit that referenced this pull request Aug 8, 2024
### What is the feature/fix?

Add app param to ignore manual replica count scaling
@nightfury1204 nightfury1204 mentioned this pull request Aug 8, 2024
4 tasks
Copy link

codecov bot commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 33.13%. Comparing base (1a027ce) to head (10562db).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3737      +/-   ##
==========================================
- Coverage   33.17%   33.13%   -0.04%     
==========================================
  Files         183      183              
  Lines       20553    20553              
==========================================
- Hits         6818     6811       -7     
- Misses      12585    12593       +8     
+ Partials     1150     1149       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

nightfury1204 added a commit that referenced this pull request Aug 9, 2024
### What is the feature/fix?

Add app param to ignore manual replica count scaling
@nightfury1204 nightfury1204 deleted the ignore-manual-scale branch September 6, 2024 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant