タグ

rate limitに関するinoueyuworksのブックマーク (2)

  • nginx rate limiting with X-Forwarded-For header

    I'm looking into rate-limiting using nginx's HttpLimitReqModule. However, requests are all coming from the same IP (a loadbalancer), with the real IP address in the headers. Is there a way to have nginx rate-limit based on the ip in the X-Forwarded-For header instead of the ip of the source?

    nginx rate limiting with X-Forwarded-For header
    inoueyuworks
    inoueyuworks 2019/12/23
    Rate Limiting において、"If you use realip module, $binary_remote_addr variable gets set correctly. "
  • 様々なrate limitアルゴリズム - Carpe Diem

    概要 インターネットに晒されているWebサービスでは TV等で紹介されたことによる大量流入 悪意ある人物からの攻撃 クライアントのバグに依る大量リクエスト など、来想定していた以上のトラフィックが来ることはよくあります。 単純にシステムを構築すると大規模トラフィックに対応できずシステムがスローダウンしてしまうため、何かしらrate limitをかけておいた方が良いです。 ただしrate limitと一口に入っても色々あるため、今回は主なrate limitアルゴリズムを紹介します。 Leaky bucket Leaky bucketはデータ転送レートを一定にする(=上限を設定する)アルゴリズムです。 下の図のように、様々な流量の水流がそのバケツに流れ込んでも小さな穴からは一定の水流が流れ出す仕組みです。 ref: What is the difference between token

    様々なrate limitアルゴリズム - Carpe Diem
    inoueyuworks
    inoueyuworks 2019/12/18
    Leaky Bucket: 一定出力の FIFO; Token Bucket: CPU Credit; Fixed window counters: timebox ごとの上限を定める。 new timebox で dispose; sliding window log: window が イベントの FIFO で、 rate limit; sliding window counters: Fixed window counters を、box の近さで重み付
  • 1