infra-scaling
БесплатноБез исполняемых скриптовНе проверенTune and review Langfuse autoscaling for web, web-iso, and web-ingestion. Use for Terraform scale settings, RPM targets, scaling bounds, task counts…
от langfuse★ 38 069 звёзд на GitHubОб этом скилле
Langfuse Infra Scaling
Use this skill for Langfuse web-ingestion, web, and web-iso autoscaling work in langfuse/infrastructure.
Goal
Optimize the cost/performance tradeoff: run the smallest reliable container footprint that preserves acceptable latency, error rate, CPU/memory headroom, event-loop health, and burst capacity. Treat both idle overprovisioning and insufficient headroom as problems. Recommendations should say which side of the tradeoff they optimize and why.
Core Rules
- Read the current branch and files first. Do not rely on remembered values.
- Do not optimize only for cost or only for latency. Prefer changes that reduce waste when health is green, and preserve or add headroom when snappy routes, errors, CPU/memory, event-loop delay, or autoscaler load show risk.
- Keep
web_ingestion_cpu = 2048unless the user explicitly overrides it. These Node.js containers reserve one CPU for the event loop and one for background work. - Treat
web_ingestion_instancesas the autoscaler minimum. Interraform/modules/ecs_service/resources.tf, the autoscaler target usesmin_capacity = var.instances. - For prod web-ingestion, keep the minimum container count at
3. - Preserve burst capacity when lowering the minimum:
max_capacity = web_ingestion_instances * web_ingestion_autoscaler_max_capacity_multiplier. - Distinguish cost levers: if a service usually sits at its minimum task count, raising RPM targets will not save money; lower the minimum after validating HA/compliance floors, and raise the max-capacity multiplier if needed to preserve burst ceiling.
- Update dashboard markers whenever RPM target or boundary changes.
- Use exact OpenTofu math for markers. Do not mental-math
ceil(target * boundary)because Terraform float behavior can produce off-by-one results. - For
webandweb-iso, do not reduce RPM per container solely because service latency is high. First inspect full APM traces, including ClickHouse spans, to distinguish container saturation from database-bound requests. - If slow
web-isotraces are dominated by ClickHouse child spans, do not lower RPM targets as the primary fix. Lowering RPM changes web-container scaling and request distribution, but it does not reduce ClickHouse query cost, total query workload, or an individual long-running query duration. - If scaling should be adjusted, create or update a GitHub PR. Step 8 has the detail.
Files
Service scaling values live in:
terraform/environments/services/env-prod-us.tfvars
terraform/environments/services/env-prod-eu.tfvars
terraform/environments/services/env-prod-hipaa.tfvars
terraform/environments/services/env-prod-jp.tfvars
Dashboard marker values live in:
terraform/environments/monitoring/env-prod-us.tfvars
terraform/environments/monitoring/env-prod-eu.tfvars
terraform/environments/monitoring/env-prod-hipaa.tfvars
terraform/environments/monitoring/env-prod-jp.tfvars
Autoscaler implementation:
terraform/environments/services/web_ingestion.tf
terraform/environments/services/web.tf
terraform/environments/services/web_isolated.tf
terraform/modules/ecs_service/resources.tf
terraform/modules/ecs_autoscaler/resources.tf
Important implementation facts:
- RPM scale-up threshold is
rpm_target + ceil(rpm_target * rpm_boundary). - RPM scale-down threshold is
rpm_target - ceil(rpm_target * rpm_boundary). - Web ingestion uses
autoscaler_up_eval_periods = 1,autoscaler_step_size = 2, and the default scale-down evaluation periods of5. - Scale-down removes
1task per step; scale-up adds2. web-isousesautoscaler_up_eval_periods = 1andautoscaler_step_size = 2.webandweb-isoRPM autoscalers do not use processed-bytes weighting;web-ingestiondoes.- Use autoscaler-aligned ALB target group filters. For
web-ingestion, use exacttargetgroup:targetgroup/${env}-web-ingestion/*. Forweb, use exacttargetgroup:targetgroup/${env}-web/*. Forweb-iso, usetargetgroup:targetgroup/${env}-web-iso*/*. Avoid broadweb-*filters because they can mixweb,web-iso, andweb-ingestion.
Workflow
- Inspect local context:
git status --short --branch
rg -n "web_ingestion_instances|web_ingestion_autoscaler_rpm_target|web_ingestion_autoscaler_rpm_boundary|web_ingestion_autoscaler_max_capacity_multiplier" terraform/environments/services/*.tfvars
- Gather current production evidence before changing thresholds. Load the Datadog metrics skill before querying Datadog.
Use Datadog US for prod-us and prod-hipaa; use Datadog EU for prod-eu and prod-jp.
Useful 7-day queries:
avg:aws.ecs.cpuutilization{servicename:prod-us-web-ingestion,environment:prod-us}.rollup(avg,60)
max:aws.ecs.cpuutilization{servicename:prod-us-web-ingestion,environment:prod-us}.rollup(max,60)
max:aws.ecs.service.running{servicename:prod-us-web-ingestion,environment:prod-us}.rollup(avg,60)
sum:aws.applicationelb.request_count_per_target{envir
Установить infra-scaling в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл infra-scaling?
Tune and review Langfuse autoscaling for web, web-iso, and web-ingestion. Use for Terraform scale settings, RPM targets, scaling bounds, task counts, cost/performance tradeoffs, or Datadog evidence in the infrastructure repo.
Как установить скилл infra-scaling?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл infra-scaling запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub