[06] Services & Scheduling Flashcards

1
Q

What types of service autoscaling does ECS support?

A

Target tracking, step scaling policies, and scheduled scaling

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

What does target tracking autoscaling do?

A

The desired count of the service is adjusted to maintain a metric at a target value

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

What is a limitation of target tracking autoscaling?

A

It only works for services that should scale-out when the metric is above the target value

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

How are scaling decisions made for scale-out and scale-in with multiple scaling policies?

A

Scale-out occurs if any of the policies are ready to scale-out, scale-in occurs if any of the policies are ready to scale-in

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

What does step scaling autoscaling do?

A

The desired count is adjusted in steps based on the size of alarm breaches

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

What is an advantage of step scaling autoscaling?

A

Step-scaling allows faster scale outs because the threshold and step size is configurable

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

What happens during a cooldown period after a scaling event?

A

Further scale-outs will only occur if they are larger than the previous event, and scale-in activities are blocked

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

What are scaling decisions based on?

A

The actual number of running tasks in the service, not the desired count

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

What happens to scale-in processes during deployments?

A

Scale-in processes are stopped during deployments, but scale-outs can occur

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

What are the most common forms of service load balancing?

A

ALBs and NLBs

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

Can NLBs be used for dynamic port mapping?

A

Yes

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

What should the load balancer’s subnet configuration include?

A

All the AZ’s that tasks are running in

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

What condition should be met to prevent 502 errors?

A

StopTimeout > target group registration delay > client connection timeout

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

What other condition should be met to prevent 502 errors?

A

task idle timeout > ALB idle timeout

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

Do the load balancer and tasks need to be in the same VPC?

A

Yes, but not necessarily the same subnets

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

What can be assigned to NLBs to give them a static IP?

A

Elastic IPs

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

Can services be registered to multiple target groups?

A

Yes, but these target groups must be used either all with ALB(s), or all with NLB(s)

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

How can NLBs be configured to terminate connections when the task is stopped?

A

By setting the connection terminate setting in the target group

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

What are the two ways to connect to a service via API Gateway?

A
  1. Create an HTTP API and route to the service using an ALB, NLB or CloudMap 2. Create a REST API, configure private integration, and route to the service using an NLB
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What does Service Connect only support connectivity between?

A

ECS services

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

Why does Service Connect only support connectivity between ECS services?

A

Because it doesn’t publish DNS records - the proxy sidecar discovers the endpoints using the CloudMap API

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

What networking modes are supported by Service Connect?

A

bridge and awsvpc

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

What features do the proxies attached to each task by Service Connect enable?

A

Round-robin load balancing, retries, and the collection of CloudWatch metrics

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

What does Service discovery integrate with?

A

Cloud Map

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

What does Service discovery support in addition to ECS clients?

A

Non-ECS clients

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

What networking modes are supported by Service discovery?

A

awsvpc and bridge for clients that support SRV records

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

What are the three states a service can be in?

A

ACTIVE, DRAINING, INACTIVE

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

When is a service in the DRAINING state?

A

Deletion has been triggered, but there are still active tasks

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

When is a service in the INACTIVE state?

A

All tasks have transitioned to STOPPING or STOPPED and ECS is ready to delete the service

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

What happens to unhealthy tasks in a service?

A

They are replaced by the service scheduler

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

If a replacement task is UNHEALTHY, what does the service scheduler do?

A

It will stop either the original or replacement task

32
Q

What are the two service scheduler strategies?

A

REPLICA, DAEMON

33
Q

What does the REPLICA scheduler strategy do?

A

The scheduler maintains the desired number of tasks and spreads tasks across AZs by default

34
Q

What does the DAEMON scheduler strategy do?

A

Exactly one instance of the task runs on each active container instance that matches the task placement constraints

35
Q

What happens with daemon tasks on an instance?

A

They launch before replica tasks are started on an instance, and are the last to stop to ensure they have priority for resource reservations

36
Q

What are the three update deployment types for services?

A

Rolling update, Blue / Green deployment with CodeDeploy, External deployment

37
Q

What is a rolling update?

A

Current tasks are incrementally replaced with new tasks

38
Q

What is minimumHealthyPercent for a rolling update?

A

The lower limit on the number of tasks that should run during a deployment, expressed as percentage of the desired count

39
Q

What is maximumPercent for a rolling update?

A

The upper limit of tasks that can run in the service relative to the desired count

40
Q

What are stuck deployments?

A

When the scheduler can’t stop or start any new tasks

41
Q

What causes a stuck deployment when tasks can’t be stopped?

A

The minimum required tasks is rounded up e.g. if the desired count is two and minimumHealthyPercent is 75%, then tasks can’t be stopped

42
Q

What causes a stuck deployment when tasks can’t be started?

A

The maximum allowed tasks is rounded down e.g. if the desired count is 2 the maximum percent is 125%, then tasks can’t be started

43
Q

What is failure detection for deployments?

A

It identifies when a deployment has failed, and optionally triggers a rollback to the last COMPLETED deployment

44
Q

What does the deployment circuit breaker check?

A

That the tasks transition to the RUNNING state, and don’t fail ELB, CloudMap or container health checks

45
Q

What is the failure threshold for the deployment circuit breaker?

A

50% of the desired task count, bounded on [3, 200] tasks

46
Q

How can CloudWatch alarms be used for custom failure detection criteria?

A

The alarm is ignored if it’s in the ALARM state at the beginning of the deployment, and during the bake time ECS continues to monitor the alarms even after the new tasks have started while the deployment remains IN_PROGRESS

47
Q

What steps does the service scheduler take to replace tasks during a deployment?

A

First removes the task from the load balancer and waits for connections to drain, then sends a SIGTERM to the container(s), then a SIGKILL if they don’t stop before the stopTimeout

48
Q

What handles Blue/Green deployments?

A

CodeDeploy

49
Q

What are the three ways to shift traffic during a Blue/Green deployment?

A

Canary, Linear, All-at-once

50
Q

What is required for a Blue/Green deployment?

A

The service must use an ALB or NLB with two target groups

51
Q

What does the external deployment type allow?

A

ECS to delegate deployment to a third-party controller, which uses the ECS API actions e.g. UpdateTaskSet

52
Q

What is task scale-in protection?

A

It prevents a specific task from being terminated by service autoscaling or a deployment

53
Q

How can task scale-in protection be set?

A

Either with the container agent endpoint or ecs:UpdateTaskProtection

54
Q

What is service throttling?

A

When service tasks repeatedly fail to reaching RUNNING

55
Q

What happens during service throttling?

A

The time between subsequent restart attempts is gradually increased up to 15 minutes

56
Q

What tasks will trigger service throttling?

A

Only tasks that never reach RUNNING, not tasks which fail health checks or immediately exit

57
Q

What service event is generated during throttling?

A

(service service-name) is unable to consistently start tasks successfully.

58
Q

What states do tasks transition through in ECS?

A

PROVISIONING, PENDING, ACTIVATING, RUNNING, DEACTIVATING, STOPPING, DEPROVISIONING, STOPPED

59
Q

What state will a task be in while ECS is performing additional steps before it is launched?

A

PROVISIONING

60
Q

What is the PROVISIONING state?

A

ECS needs to perform additional steps before the task is launched e.g. provision an ENI for the task if it’s awsvpc

61
Q

What state is a task in when ECS is waiting for the agent to take further action?

A

PENDING

62
Q

What is the PENDING state?

A

ECS is waiting for the agent to take further action

63
Q

What state is a task in when ECS is performing additional steps after it has launched?

A

ACTIVATING

64
Q

What is the ACTIVATING state?

A

ECS is performing additional steps after the task has launched e.g. registering it with an ELB target group

65
Q

What state is a task in when it is successfully running?

A

RUNNING

66
Q

What is the RUNNING state?

A

The task is successfully running

67
Q

What state is a task in when ECS is performing additional steps before stopping it?

A

DEACTIVATING

68
Q

What is the DEACTIVATING state?

A

ECS is performing additional steps before the tasks is stopped e.g. deregistering it from a target group

69
Q

What state is a task in when ECS is waiting for the agent to stop it?

A

STOPPING

70
Q

What is the STOPPING state?

A

ECS is waiting for the ECS agent to take further action

71
Q

What linux parameters are supported for stopping tasks?

A

For Linux containers, the agent sends a SIGTERM to the container(s), then SIGKILL after waiting the stopTimeout

72
Q

What state is a task in when ECS is performing additional steps after stopping it?

A

DEPROVISIONING

73
Q

What is the DEPROVISIONING state?

A

ECS is performing additional steps e.g. deleting the ENI for awsvpc tasks

74
Q

What state is a task in after it has been successfully stopped?

A

STOPPED

75
Q

What is the STOPPED state?

A

The task has been successfully stopped