搜索

PythonReactSEOPDF
GitHub Skill

autoscaler

Scale GPU workloads up or down based on utilization, queue depth, or request latency.

redclawsystems☆ 34 仓库 Stars1 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Autoscaler

Scaling Decisions

Before scaling, gather:

  1. GPU utilization across nodes (nvidia-smi)
  2. Request queue depth / latency (application metrics)
  3. Available capacity (idle GPUs on other nodes)
  4. Cost implications

Check Current Load

# GPU utilization across a node
exec host=node node=<name> command="nvidia-smi --query-gpu=index,utilization.gpu,memory.used,memory.total --format=csv,noheader"

# Container resource usage
exec host=node node=<name> command="docker stats --no-stream --format '{{.Name}}: CPU={{.CPUPerc}} MEM={{.MemUsage}}'"

# Application-level metrics (if exposed)
exec host=node node=<name> command="curl -s http://localhost:8000/metrics 2>/dev/null | grep -E 'request_queue|latency|throughput' || echo 'no app metrics'"

Scale Up (add replicas)

# Find a node with available GPUs
# 1. Check all nodes for idle GPUs (utilization < 10%)
# 2. Pick the node with most free VRAM
# 3. Deploy additional replica

exec host=node node=<target-node> command="docker run -d --gpus all --name <service>-replica-2 -p <port>:<port> <image> <args>"

Scale Down

# Identify underutilized replicas
# If GPU utilization < 5% for extended period, remove replica
exec host=node node=<name> command="docker stop <service>-replica-2 && docker rm <service>-replica-2"

Scaling Thresholds (defaults)

Metric Scale Up Scale Down
GPU util > 85% sustained 5min < 15% sustained 10min
VRAM usage > 90% < 30%
Request latency > 2x baseline < 0.5x baseline
Queue depth > 100 pending 0 pending for 10min

Monitoring via Cron

Set up periodic checks:

Use cron tool to schedule a job every 5 minutes that:
1. Checks GPU utilization on all nodes
2. If any node > 85% for 3 consecutive checks → scale up
3. If all replicas < 15% → scale down one replica
4. Report scaling actions to the user

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-03-11
索引更新时间
2026-03-11
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!