Skip to content

Commit 803d02f

Browse files
committed
Updates on the 30min replacement frequency
1 parent 3e97329 commit 803d02f

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

Diff for: TECHNICAL_DETAILS.md

+12-16
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ configured but cheaper spot instances.
176176

177177
The replacements are done using the relatively new Attach/Detach actions
178178
supported by the AutoScaling API. A new compatible spot instance is launched,
179-
and after a while, at least as much as the group's grace period, it will be
180-
attached to the group, while at the same time an on-demand instance is detached
181-
from the group and terminated in order to keep the group at constant capacity.
179+
and it will be immediately attached to the group, while at the same time an
180+
on-demand instance is detached from the group and terminated in order to keep
181+
the group at constant capacity.
182182

183183
When assessing the compatibility, it takes into account the hardware specs, such
184184
as CPU cores, RAM size, attached instance store volumes and their type and size,
@@ -205,14 +205,14 @@ During multiple replacements performed on a given group, it only swaps them one
205205
at a time per Lambda function invocation, in order to not change the group too
206206
fast, but instances belonging to multiple groups can be replaced concurrently.
207207
If you find this slow, the Lambda function invocation frequency (defaulting to
208-
once every 5 minutes) can be changed by updating the stack, which has a
208+
once every 30 minutes) can be changed by updating the stack, which has a
209209
parameter for it.
210210

211211
In the (so far unlikely) case in which the market price is high enough that
212212
there are no spot instances that can be launched, (and also in case of software
213213
crashes which may still rarely happen), the group would not be changed and it
214214
would keep running as it is, but AutoSpotting will continuously attempt to
215-
replace them, until eventually the prices decrease again and replaecments may
215+
replace them, until eventually the prices decrease again and replacements may
216216
succeed again.
217217

218218
## Internal components ##
@@ -223,7 +223,7 @@ Amazon AWS account, created automatically with CloudFormation or Terraform:
223223
### Event generator ###
224224

225225
CloudWatch event source used for triggering the Lambda function. The default
226-
frequency is every 5 minutes, but it is configurable using stack parameters.
226+
frequency is every 30 minutes, but it is configurable using stack parameters.
227227

228228
### Lambda function ###
229229

@@ -236,18 +236,14 @@ frequency is every 5 minutes, but it is configurable using stack parameters.
236236
of passing any explicit AWS credentials or access keys.
237237
- Some algorithm parameters can be configured using Lambda environment
238238
variables, based on some of the stack parameters.
239-
- Contains a handler written in Golang, built using the
240-
[eawsy/aws-lambda-go](https://github.com/eawsy/aws-lambda-go) library, which
241-
implements a novel aproach that allows Golang code compiled natively to be
242-
built in such a way that it can be injected into the Lambda Python runtime.
243-
- The handler implements all the instance replacement logic.
239+
- Contains a handler written in Golang which implements all the instance
240+
replacement logic.
244241
- The spot instances are created by duplicating the configuration of the
245242
currently running on-demand instances as closely as possible(IAM roles,
246-
security groups, user_data script, etc.) only by adding a spot bid price
247-
attribute and eventually changing the instance type to a usually bigger, but
248-
compatible one.
249-
- The bid price is set to the on-demand price of the instances configured
250-
initially on the AutoScaling group.
243+
security groups, user_data script, etc.), maybe changing the instance type
244+
to a usually bigger, but compatible one.
245+
- The Spot price is set by default to the on-demand price of the instances configured
246+
initially on the AutoScaling group, but this is configurable.
251247
- The new launch configuration may also have a different instance type,
252248
determined based on compatibility with the original instance type,
253249
considering also how much redundancy we need to have in place in the current

Diff for: cloudformation/stacks/AutoSpotting/parameters.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# DeployRegionalResourcesStackSet: 'true'
1010
# SQSQueueName: AutoSpotting.fifo
1111

12-
# Default value: rate(5 minutes)
13-
ExecutionFrequency: rate(30 minute)
12+
# Default value: rate(30 minutes)
13+
ExecutionFrequency: rate(2 minutes)
1414

1515
# Tag to be applied on the Lambda function
1616
LambdaFunctionTagKey: Name

Diff for: kubernetes/autospotting-cron.yaml.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ kind: CronJob
66
metadata:
77
name: autospotting
88
spec:
9-
schedule: "*/5 * * * *" # run every 5 minutes
9+
schedule: "*/5 * * * *" # run every 30 minutes
1010
startingDeadlineSeconds: 10 # skip if it hasn't started in this many seconds
1111
concurrencyPolicy: Forbid # either allow|forbid|replace
1212
successfulJobsHistoryLimit: 3 # how many completed jobs should be kept

0 commit comments

Comments
 (0)