Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)48k · #4697

gcp-cloud-run

Skill này làm gì

Công cụ này giúp xây dựng ứng dụng trên Google Cloud (GCP) mà không cần quản lý máy chủ. Nó xử lý cả các ứng dụng nhận lệnh (dịch vụ) và các ứng dụng phản ứng với sự kiện, tối ưu thời gian phản hồi và mức sử dụng tài nguyên.

Khi nào nên dùng

  • ✓Khi xây dựng một dịch vụ web chạy trên đám mây.
  • ✓Khi tạo một chương trình phản ứng với thông báo.
  • ✓Khi tối ưu tốc độ của các ứng dụng trên đám mây.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/gcp-cloud-run/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/gcp-cloud-run/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một dịch vụ đám mây cho website thương mại điện tử của tôi, có thể tự động mở rộng.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn mô tả ứng dụng như một gói (container image), và Google Cloud Run lo việc chạy và quản lý hạ tầng. Nó cũng có thể được cấu hình để phản hồi sự kiện.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

GCP Cloud Run

Specialized skill for building production-ready serverless applications on GCP. Covers Cloud Run services (containerized), Cloud Run Functions (event-driven), cold start optimization, and event-driven architecture with Pub/Sub.

Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

Calculate memory including /tmp usage

# cloudbuild.yaml
steps:
  - name: 'gcr.io/cloud-builders/gcloud'
    args:
      - 'run'
      - 'deploy'
      - 'my-service'
      - '--memory=1Gi'  # Include /tmp overhead
      - '--image=gcr.io/$PROJECT_ID/my-service'

Monitor memory usage

import psutil
import logging

def log_memory():
    memory = psutil.virtual_memory()
    logging.info(f"Memory: {memory.percent}% used, "
                f"{memory.available / 1024 / 1024:.0f}MB available")

Concurrency=1 Causes Scaling Bottlenecks

Severity: HIGH

Situation: Setting concurrency to 1 for request isolation

Symptoms: Auto-scaling creates many container instances. High latency during traffic spikes. Increased cold starts. Higher costs from more instances.

Why this breaks: Setting concurrency to 1 means each container handles only one request at a time. During traffic spikes:

  • 100 concurrent requests = 100 container instances
  • Each instance has cold start overhead
  • More instances = higher costs
  • Scaling takes time, requests queue up

This should only be used when:

  • Processing is truly single-threaded
  • Memory-heavy per-request processing
  • Using thread-unsafe libraries

Recommended fix:

When to Use

Use this skill when the request clearly matches the capabilities and patterns described above.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Câu hỏi thường gặp

'Cold start' là gì?

Đây là thời gian để một ứng dụng khởi động khi nó không được dùng và nhận một yêu cầu mới.

'concurrency=1' nghĩa là gì?

Nghĩa là mỗi thực thể của ứng dụng chỉ xử lý được một yêu cầu tại một thời điểm. Điều này có thể gây chậm nếu nhiều yêu cầu đến cùng lúc.

Pub/Sub là gì?

Đây là dịch vụ của Google Cloud cho phép gửi và nhận thông điệp giữa các phần khác nhau của một ứng dụng, giúp giao tiếp và phản ứng với sự kiện.

Chi tiết

Mô tả gốc của tác giả

Specialized skill for building production-ready serverless applications on GCP. Covers Cloud Run services (containerized), Cloud Run Functions (event-driven), cold start optimization, and event-driven architecture with Pub/Sub.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4697
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự