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

[WIP] Autoscaling management #188

Merged
merged 4 commits into from
May 15, 2024
Merged

[WIP] Autoscaling management #188

merged 4 commits into from
May 15, 2024

Conversation

olehkorkh-planeks
Copy link
Collaborator

No description provided.

mcserver/utils.py Outdated Show resolved Hide resolved
@@ -275,6 +275,10 @@ def strip_sensitive_data(event, hint):
'task': 'mcserver.tasks.delete_pingdom_sessions',
'schedule': crontab(hour='*', minute=0)
},
'submit_cloudwatch_metric': {
'task': 'mcserver.tasks.submit_cloudwatch_metrics',
'schedule': crontab(minute='*')
Copy link
Collaborator

Choose a reason for hiding this comment

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

@olehkorkh-planeks @sashasimkin @suhlrich is it possible to have a finer resolution or is 1 minute the best we can do? It seems a little slow

Choose a reason for hiding this comment

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

@antoinefalisse this is what I suggested here in point #1.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you explain what you mean with aggregates of 1 minutes?

Choose a reason for hiding this comment

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

@antoinefalisse check this documentation about target tracking(search for "aggregated at a one-minute granularity" text if highlight doesn't work).

Few more arguments against higher resolution metrics:

  1. From what I understand the trials processed around 1-60 minutes, so I don't expect rapid changes when all trials are processed
  2. I've configured scale in/out cooldowns to 5m to avoid instances flapping
  3. I saw in the code logic to cool-down the worker instance before unprotecting it, which adds to the delay

"""
client = boto3.client(
'cloudwatch',
aws_access_key_id=settings.AWS_ACCESS_KEY_ID,

Choose a reason for hiding this comment

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

You don't need to explicitly specify these because I assigned task role to the celery task which will allow boto3 to infer the credentials from environment.

'cloudwatch',
aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
region_name='us-west-2',

This comment was marked as outdated.

@antoinefalisse antoinefalisse merged commit e524163 into dev May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants