본문으로 건너뛰기
cccskills
무료GitHub에 공개

cold-start

References cold start optimization history and techniques. Covers Docker image optimization, Fargate CPU tuning, SOCI lazy loading, and Lambda Bedrock discovery fix. Use when optimizing startup performance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

serithemage/serverless-openclaw스타 196(GitHub 196 + cccskills 0)
연동 도구AWSDocker

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md4.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Cold Start Optimization Reference

Full analysis: docs/cold-start-optimization.md

Results Summary

TargetBeforeAfterSavings
Docker image size2.22 GB1.27 GB43% reduction
Fargate cold start~120s (0.25 vCPU)~40-57s (1 vCPU)~80s
Lambda cold start56s1.35s~54s

Measurement Commands

make cold-start        # Full measurement (stops tasks + cleans TaskState first)
make cold-start-warm   # Warm start measurement (skip idle wait)
make task-status       # Verify task state before measuring
make task-stop         # Stop all tasks
make task-stop-recent  # Stop only most recent task

Important: Always use make cold-start — never run the measurement script directly without stopping existing tasks first.

Docker Image Optimizations (Fargate)

OptimizationSavingsTechnique
Remove AWS CLI-358 MBReplaced aws s3 sync with @aws-sdk/client-s3 Node.js code (s3-sync.ts)
chown layer optimization-134 MBCOPY --chown=openclaw:openclaw instead of separate RUN chown
Pre-generated openclaw config—Handled in Dockerfile (skip runtime onboard)
start-openclaw.sh simplification—Removed S3 restore/onboard/sleep 2
zstd compression (P6)-16% (258→217 MB)--compression zstd in docker buildx

SOCI Lazy Loading

./scripts/deploy-image.sh --soci   # Linux only, ~50% additional pull-time reduction

SOCI CI: .github/workflows/deploy-image.yml

Fargate CPU Tuning (P7)

CPUMemoryCold Start
0.25 vCPU512 MBOOM Kill
0.25 vCPU2048 MB~120s
0.5 vCPU2048 MB~80s
1 vCPU2048 MB~40-57s (default)
2 vCPU4096 MBConfigurable via env

Configure via env vars: FARGATE_CPU, FARGATE_MEMORY

Container Startup Parallelization

  • S3 restore + History load run via Promise.all (~3-5s saved)
  • IP discovery runs non-blocking (Bridge starts serving while discovery continues)
  • Stale IP fix: Bridge HTTP timeout 10s→3s, fallback to PendingMessages on failure

Lambda Cold Start (Phase 2 — The Biggest Win)

Root cause: Bedrock auto-discovery scanned all AWS regions on startup → 56s delay

Fix: bedrockDiscovery.enabled: false in OpenClaw config → 1.35s cold start

{
  "bedrockDiscovery": { "enabled": false }
}

Lambda Optimization Techniques

  • runEmbeddedPiAgent() — bypasses Gateway WS server (no :18789 socket bind)
  • extensionAPI.js via file:// URL (not in exports map)
  • HOME=/tmp (Lambda read-only filesystem)
  • Sessions in /tmp (ephemeral, acceptable for Lambda)
  • No S3 session restore (Lambda starts fresh each cold start)

OpenClaw Version Impact on Cold Start

VersionCold StartStatus
v2026.2.965.3sWorking
v2026.2.1357.9sWorking — pinned
v2026.2.14N/ABROKEN (scope system)

Pin location: packages/container/Dockerfile

ARG OPENCLAW_VERSION=2026.2.13

Configurable via build-arg or env var.

Watchdog Dynamic Timeout

  • Active hours: 30-min idle timeout
  • Inactive hours: 10-min idle timeout
  • Based on CloudWatch activity metrics
  • Watchdog skips pre-warmed tasks where now < prewarmUntil

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

References Serverless OpenClaw architecture. Covers network design, CDK stack structure, DynamoDB data model, API protocols, and container design.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

serithemage/serverless-openclaw1962026년 3월 29일 업데이트

context

무료

Loads Serverless OpenClaw project context. Provides background knowledge needed for development including project overview, tech stack, architecture decisions, and data models.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

serithemage/serverless-openclaw1962026년 3월 29일 업데이트

cost

무료

References Serverless OpenClaw cost optimization guidelines. Validates that no resources exceeding the cost target ($1/month) are created during implementation. Use when writing CDK stacks or making infrastructure changes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

serithemage/serverless-openclaw1962026년 3월 29일 업데이트

deploy

무료

Deploys Serverless OpenClaw CDK stacks to AWS. Handles SecretsStack parameter injection, full/individual stack deployment, and Docker image push.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

serithemage/serverless-openclaw1962026년 3월 29일 업데이트

dev

무료

Development workflow guide. Covers build, test, lint, format commands, package structure, Git hooks, TDD methodology, and coding conventions. Use when setting up dev environment, running tests, or following project conventions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

serithemage/serverless-openclaw1962026년 3월 29일 업데이트

implement

무료

Guides Phase 1 MVP implementation steps. Pass a specific step number as an argument to get the goals, deliverables, validation criteria, and detailed design for that step.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

serithemage/serverless-openclaw1962026년 3월 29일 업데이트

serithemage의 스킬 모두 보기

이 스킬의 문제 신고