9 bis_Auto Scaling Flashcards

1
Q

Auto Scaling

Auto Scaling resizes your computer clusters (Amazon EC2 instances) based on demand.

A

Auto Scaling

Auto Scaling resizes your computer clusters (Amazon EC2 instances) based on demand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Auto Scaling components

  • Groups: Logical component. Webserver group or Application group or Database group, etc.
  • Configuration Templates: Groups uses a launch template or a launch configuration as a configuration template for its EC2 instances. You can specify information such as the AMI ID, instance type, keyp pair, security groups, and block device mapping for your instances.
  • Scaling Options: provides several ways for you to scale your Auto Scaling groups. For example, you can configure a group to scale based on the occurence of specified conditions (dynamic scaling) or on a schedule.
A

Auto Scaling components

  • Launch configuration: defines how Auto Scaling should launch your Amazon EC2 instances (similar to creating EC2 instances)
  • Auto Scaling group: uses a launch configuration to launch Amazon EC2 instances
  • Auto Scaling policy: uses a combination of policies and alarms to determine when the specified conditions for launching and terminating instances are met
  • Scheduled action: allows you to scale your application in response to predictable load changes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Auto Scaling Consideration

  • Avoid Auto Scaling thrashing
    • Be more cautious about scaling in ( = you are decreasing the computing capacity due to low utilization); avoid aggressive instance termination
    • Scale out early, scale in slowly
  • Set the min, max, and desired capacity parameter values carefully
    • Desired capacity determines how many instances will be running whenever there are no scaling policies being applied
  • You cannot modify a Launch Configuration. If you want to modify the LC for a running Auto Scaling Group, you need to create a new LC and then assign it to the ASG. New instances will use the new LC and previous instances will still be running.
  • Auto Scaling cannot span multiple regions
A

Auto Scaling Consideration

  • Avoid Auto Scaling thrashing
    • Be more cautious about scaling in ( = you are decreasing the computing capacity due to low utilization); avoid aggressive instance termination
    • Scale out early, scale in slowly
  • Set the min, max, and desired capacity parameter values carefully
    • Desired capacity determines how many instances will be running whenever there are no scaling policies being applied
  • You cannot modify a Launch Configuration. If you want to modify the LC for a running Auto Scaling Group, you need to create a new LC and then assign it to the ASG. New instances will use the new LC and previous instances will still be running.
  • Auto Scaling cannot span multiple regions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Auto Scaling - Dynamic & Scheduled

Dynamic scaling creates target tracking scaling policies for the resources in your scaling plan. These scaling policies adjust resource capacity in response to live changes in resource utilization. The intention is to provide enough capacity to maintain utilization at the target value specified by the scaling strategy. This is similar to the way that your thermostat maintains the temperature of your home. You choose the temperature and the thermostat does the rest.

Scheduled scaling allows you to scale your application in response to predictable load changes. For example, every week the traffic to your web application starts to increase on Wednesday, remains high on Thursday, and starts to decrease on Friday. You can plan your scaling actions based on the predictable traffic patterns of your web application.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Auto Scaling - Cooldown

The cooldown period ensures that your Auto Scaling group doesn’t launch or terminate additional instances before the previous scaling activity takes effect. You can configure the length of time based on your instance warm-up period or other application needs.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Auto Scaling - Loose Coupling

State information that contains information that is unique to the user (HTTP session information) is often used when generating dynamic content.

State sharing pattern lets you maintain state information in a scale-out structure. The state information is referenced by multiple servers. This makes the server “stateless”, having no state information.

Stateless Application: An application that needs no knowledge of previous interactions and stores no session information.

A

Auto Scaling - Loose Coupling

State information that contains information that is unique to the user (HTTP session information) is often used when generating dynamic content.

State sharing pattern lets you maintain state information in a scale-out structure. The state information is referenced by multiple servers. This makes the server “stateless”, having no state information.

Stateless Application: An application that needs no knowledge of previous interactions and stores no session information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Auto Scaling Lifecycle Hooks

Auto Scaling lifecycle hooks enable you to perform custom actions as Auto Scaling launches or terminates instances. For example, you could install or configure software on newly launched instances, or download log files from an instance before it terminates.

Each Auto Scaling group can have multiple lifecycle hooks. However, there is a limit on the number of hooks per Auto Scaling group.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Auto Scaling Lifecycle Hooks

  1. Auto Scaling responds to scale out events by launching instances and scale in events by terminating instances.
  2. Auto Scaling puts the instance into a wait state (Pending:Wait or Terminating:Wait). The instance remains in this state until either you tell Auto Scaling to continue or the timeout period ends.
  3. You can perform a custom action using one or more of the following options:
  • Define a CloudWatch Events target to invoke a Lambda function when a lifecycle action occurs. The Lambda function is invoked when Auto Scaling submits an event for a lifecycle action to CloudWatch Events. The event contains information about the instance that is launching or terminating, and a token that you can use to control the lifecycle action.
  • Define a notification target for the lifecycle hook. Auto Scaling sends a message to the notification target. The message contains information about the instance that is launching or terminating, and a token that you can use to control the lifecycle action.
  • Create a script that runs on the instance as the instance starts. The script can control the lifecycle action using the ID of the instance on which it runs
  1. By default, the instance remains in a wait state for one hour, and then Auto Scaling continues the launch or terminate process (Pending:Proceed or Terminating:Proceed). If you need more time, you can restart the timeout period by recording a heartbeat. If you finish before the timeout period ends, you can complete the lifecycle action, which continues the launch or termination process.
A

Auto Scaling Lifecycle Hooks

  1. Auto Scaling responds to scale out events by launching instances and scale in events by terminating instances.
  2. Auto Scaling puts the instance into a wait state (Pending:Wait or Terminating:Wait). The instance remains in this state until either you tell Auto Scaling to continue or the timeout period ends.
  3. You can perform a custom action using one or more of the following options:
  • Define a CloudWatch Events target to invoke a Lambda function when a lifecycle action occurs. The Lambda function is invoked when Auto Scaling submits an event for a lifecycle action to CloudWatch Events. The event contains information about the instance that is launching or terminating, and a token that you can use to control the lifecycle action.
  • Define a notification target for the lifecycle hook. Auto Scaling sends a message to the notification target. The message contains information about the instance that is launching or terminating, and a token that you can use to control the lifecycle action.
  • Create a script that runs on the instance as the instance starts. The script can control the lifecycle action using the ID of the instance on which it runs.
  1. By default, the instance remains in a wait state for one hour, and then Auto Scaling continues the launch or terminate process (Pending:Proceed or Terminating:Proceed). If you need more time, you can restart the timeout period by recording a heartbeat. If you finish before the timeout period ends, you can complete the lifecycle action, which continues the launch or termination process.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Autoscaling Options [SAA-C02]

  • Maintain current instance levels at all times
  • Scale manually
  • Scale based on a schedule
  • Scale based on demand
  • Use predictive scaling
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly