Rate Limitとは?
rate limitは、クライアントが一定の時間枠内にサービスへ送れるリクエスト数を制限し、超過分を拒否または遅延させる制御です。サービスが圧倒されるのを防ぎ、公平な共有を保証し、不正利用を緩和します。APIは一般に1分または1時間あたりのリクエスト数として表現し、超過時には429ステータスを返します。
なぜ重要か
CIのpipelineは外部API、GitHub API、コンテナレジストリ、パッケージミラーへ絶えずアクセスし、大量の並列実行中にrate limitに引っかかることがあります。429レスポンスをbackoffで処理し、レスポンスをcacheし、認証してより高い上限を得ることで、buildがスロットリングで失敗するのを防げます。
関連する概念
- 429 Too Many Requestsは上限到達を示す
- retryと指数バックオフで処理する
- 認証はしばしば上限を引き上げる
関連ガイド
What Is Retry with Backoff?Retry with backoff re-attempts a failed operation after progressively longer waits, often with jitter, to han…
What Is a Circuit Breaker?A circuit breaker stops calling a failing dependency for a cooldown period to prevent cascading failures and…
What Is a Webhook?A webhook is an HTTP callback that a system sends to a URL you specify when an event occurs, enabling event-d…