Code Monkey home page Code Monkey logo

Comments (5)

mattklein123 avatar mattklein123 commented on June 30, 2024

cc @wbpcode who has been looking at this recently

from envoy.

wbpcode avatar wbpcode commented on June 30, 2024

could you provide a configuration about your test?

from envoy.

cam634 avatar cam634 commented on June 30, 2024
spec:
  configPatches:
  - applyTo: HTTP_FILTER
    match:
      context: GATEWAY
      listener:
        filterChain:
          filter:
            name: envoy.filters.network.http_connection_manager
    patch:
      operation: INSERT_BEFORE
      value:
        name: envoy.filters.http.local_ratelimit
        typed_config:
          '@type': type.googleapis.com/udpa.type.v1.TypedStruct
          type_url: type.googleapis.com/envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit
          value:
            stat_prefix: http_local_rate_limiter
  - applyTo: HTTP_ROUTE
    match:
      context: GATEWAY
    patch:
      operation: MERGE
      value:
        route:
          rate_limits:
          - actions:
            - remote_address: {}
          - actions:
            - header_value_match:
                descriptor_value: healthcheck
                expect_match: false
                headers:
                - name: :path
                  string_match:
                    ignore_case: true
                    prefix: /healthcheck/
        typed_per_filter_config:
          envoy.filters.http.local_ratelimit:
            '@type': type.googleapis.com/envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit
            always_consume_default_token_bucket: false
            descriptors:
            - entries:
              - key: header_match
                value: healthcheck
              token_bucket:
                fill_interval: 1s
                max_tokens: 100
                tokens_per_fill: 100
            enable_x_ratelimit_headers: DRAFT_VERSION_03
            filter_enabled:
              default_value:
                denominator: HUNDRED
                numerator: 100
              runtime_key: http_local_rate_limiter
            filter_enforced:
              default_value:
                denominator: HUNDRED
                numerator: 0
              runtime_key: http_local_rate_limiter
            response_headers_to_add:
            - append: false
              header:
                key: x-local-rate-limit
                value: "true"
            stat_prefix: http_local_rate_limiter
            token_bucket:
              fill_interval: 1s
              max_tokens: 1100
              tokens_per_fill: 1100
  workloadSelector:
    labels:
      app.kubernetes.io/component: istio-ingressgateway

This was the configuration for the test

from envoy.

wbpcode avatar wbpcode commented on June 30, 2024

cc @cam634 The configuration seems fine. From the configuration, the requests with /healthcheck/ path will be limited to 100/s and other request will be limited to 1100/s? Right?

Are you ensure the test requests have the expected prefix? Could you also give an example?

(PS: the current local rate limit use a timer based token bucket which sometime are inaccurate. But you results still be weird because the difference is too big)

from envoy.

cam634 avatar cam634 commented on June 30, 2024

Yeah that's exactly what we are trying to do,

Are you ensure the test requests have the expected prefix? Could you also give an example?

This was an original thought of mine but something that debunked that for me was we hold at the right number that should be rate limited until about 2,000 RPS. We were calling a path called /ping.

I have not looked in the current code but could the filter possibly be overwhelmed at certain rates. Since it doesn't directly correlate with RPS coming in that it's leaking up.

We are going to test at more realistic number but am trying to understand why it would happen at the lower levels even

from envoy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.