0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

指数バックオフ

Posted at

「指数バックオフ(exponential backoff)」は、リトライ(再試行)間隔を指数関数的に増やしていくアルゴリズムのことです。

主に、APIアクセスやネットワーク通信でエラーやタイムアウトが発生したときに利用されます。


基本の考え方

  • 1回目のリトライは短い待機時間(例: 1秒)。
  • 失敗したら待機時間を2倍にして再試行(例: 2秒)。
  • さらに失敗したら 4秒、8秒 … と、待機時間を指数的に増加させる。
  • 最大待機時間(上限)を設定するのが一般的。

APIにリクエスト → 失敗した場合:

1回目:1秒待機して再試行
2回目:2秒待機して再試行
3回目:4秒待機して再試行
4回目:8秒待機して再試行
…(最大60秒などで上限設定)


利用される場面

  • クラウドAPI呼び出し(AWS, GCP, Azure など)
  • 分散システムの通信再試行
  • 一時的なリソース不足や障害の回避

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?