Skip to main content

Configuration

The Fast Autoscaler can be configured using environment variables to customize its behavior.

Environment Variables

VariableDescriptionDefault
ECS_CLUSTERECS cluster name(required)
SERVICE_NAMEECS service name(required)
SQS_QUEUE_URLURL of the SQS queue to monitor(required)
MIN_TASKSMinimum number of tasks10
MAX_TASKSMaximum number of tasks300
SCALE_UP_THRESHOLDQueue size threshold for scaling up100.0
SCALE_DOWN_THRESHOLDQueue size threshold for scaling down99.0
SCALE_OUT_COOLDOWNCooldown period for scaling out (seconds)120
SCALE_IN_COOLDOWNCooldown period for scaling in (seconds)120
SCALING_STEP_COUNTStep count for scaling operations5
TASKS_PER_MESSAGETask-to-message ratio for scaling calculations0.01
MAX_SCALE_DOWN_FACTORMaximum scale down percentage0.99
USE_COMBINED_MESSAGESInclude in-flight messages in scaling decisionsFalse
S3_CONFIG_BUCKETS3 bucket for state storagetf-configuration-bucket-test
LOG_LEVELLogging levelINFO

Configuration Examples

Basic Configuration

# Required variables
ECS_CLUSTER=production-cluster
SERVICE_NAME=worker-service
SQS_QUEUE_URL=https://sqs.us-east-1.amazonaws.com/123456789012/worker-queue

# Optional tuning
MIN_TASKS=5
MAX_TASKS=100
SCALE_UP_THRESHOLD=50
SCALE_DOWN_THRESHOLD=10

Advanced Configuration

# Required variables
ECS_CLUSTER=production-cluster
SERVICE_NAME=worker-service
SQS_QUEUE_URL=https://sqs.us-east-1.amazonaws.com/123456789012/worker-queue

# Task constraints
MIN_TASKS=5
MAX_TASKS=100

# Scaling behavior
SCALE_UP_THRESHOLD=50
SCALE_DOWN_THRESHOLD=10
TASKS_PER_MESSAGE=0.025
MAX_SCALE_DOWN_FACTOR=0.8

# Cooldown periods
SCALE_OUT_COOLDOWN=60
SCALE_IN_COOLDOWN=300

# Use combined (visible + in-flight) messages for scaling decisions
USE_COMBINED_MESSAGES=True