Skip to content

how to config bandwidth limit #13604

Closed

Description

@chwetion

requirement: such as limit bandwidth when client upload file to server 20kb/s
i find a filter "envoy.config.filter.fault.v2" https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/filter/fault/v2/fault.proto#config-filter-fault-v2-faultratelimit-fixedlimit.
can i use this envoy filter to solve this question?
if it can, how config?

Activity

  1. added
    triage
    on Oct 16, 2020
  2. changed the title [-]how to configuration bandwidth limit[/-] [+]how to config bandwidth limit[/+] on Oct 16, 2020
  3. htuch commented on Oct 16, 2020

    @htuch
    Member

    Fault filter is not the right choice for this. I don't think we have any traffic shaping support like this in Envoy, @mattklein123 @tonya11en for thoughts.

  4. added
    enhancement
    and removed
    triage
    on Oct 16, 2020
  5. tonya11en commented on Oct 16, 2020

    @tonya11en
    Member

    I don't think there's a way for Envoy to understand your client's protocol out-of-the-box, so you'd probably have to implement a custom filter for that. It seems like local/global rate limit filters would be of much help either since they are limiting connections or keys sent to a ratelimit service.

    @chwetion can you be more specific about what it is you're hoping to accomplish? Mainly, zoom in on what you mean by client and whether you're trying to ratelimit specifically file uploads (or some other protocol) or all network traffic. Also, are you hoping for hard-limits or "best effort" beyond some configured threshold?

  6. mattklein123 commented on Oct 16, 2020

    @mattklein123
    Member

    The fault filter does have bandwidth limiting. Whether it's the right thing to use for your case is a different question. It's possible that functionality could be moved into an independent filter.

  7. chwetion commented on Oct 19, 2020

    @chwetion
    Author

    client means downstream, it will call upstream(tomcat)'s upload file interface. @tonya11en
    i think i want like this issue: #6551

  8. chwetion commented on Oct 19, 2020

    @chwetion
    Author

    is there any doc for this? @mattklein123

    The fault filter does have bandwidth limiting. Whether it's the right thing to use for your case is a different question. It's possible that functionality could be moved into an independent filter.

  9. htuch commented on Oct 19, 2020

    @htuch
    Member

    Seems like a traffic shaping filter that factors this functionality out would be cleanest, since the goals of production traffic shaping might not always align with fault testing.

  10. mattklein123 commented on Oct 19, 2020

    @mattklein123
    Member

    Seems like a traffic shaping filter the factors this functionality out would be cleanest, since the goals of production traffic shaping might not always align with fault testing.

    Agreed

  11. chwetion commented on Oct 20, 2020

    @chwetion
    Author

    @htuch does the community currently have plans for bandwidth limit filter?
    @mattklein123 i already use http fault filter but not my expected, it cannot limit downstream upload file to upstream speed. i see just response_rate_limit, i think upload should use request rate limit.
    java upload file demo application: https://github.com/Chwetion/upload-demo

  12. htuch commented on Oct 20, 2020

    @htuch
    Member

    @chwetion not that I know of, I suggest opening a tracking issue (or converting this issue into that).

  13. 2 remaining items

  14. nitgoy commented on Nov 18, 2020

    @nitgoy
    Contributor

    @mattklein123 @htuch @tonya11en forgot to ask before - are you guys ok with me taking a stab at this extension and that it is not already under development. Please also let me know if there's any specific design template to be followed.

  15. tonya11en commented on Nov 18, 2020

    @tonya11en
    Member

    I don't think anyone has started on this yet. How do you imagine the proto config should look?

  16. nitgoy commented on Nov 19, 2020

    @nitgoy
    Contributor

    Let me know any feedback on it. Regarding the last param, any suggestions on monitoring the current total bandwidth usage? I was thinking of having a sort of stream limiter in the global config for the filter, that can count the usage at global level and the filter consults that in addition to the route/vh level stream limiter. But ideally it would be good to have it independent of the bandwidth limit filter (probably as a resource monitor) so that the info can be queried by other components in addition to the filter e.g. the overload manager. Thoughts?

  17. tonya11en commented on Nov 19, 2020

    @tonya11en
    Member

    @nitgoy this looks great! Let's have the discussion in a PR though so we can comment on lines and whatnot. I think you can just open up a draft PR with that proto and then publish it with the implementation when you're ready for folks to review.

  18. nitgoy commented on Nov 19, 2020

    @nitgoy
    Contributor

    Sure, here you go: #14096

  19. nitgoy commented on Dec 16, 2020

    @nitgoy
    Contributor

    Sorry for the long wait but now I have added the filter code with UTs. I'm working on the docs changes and few more tests. Please take a look at the PR and let me know your thoughts.

  20. github-actions commented on Jan 15, 2021

    @github-actions

    This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

  21. added
    stale
    on Jan 15, 2021
  22. github-actions commented on Jan 22, 2021

    @github-actions

    This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

  23. added a commit that references this issue on May 25, 2021
    a467b0e
  24. added a commit that references this issue on Sep 30, 2021
    0077d04
  25. shou1dwe commented on Oct 21, 2021

    @shou1dwe

    Is there a TCP flavor of this available? a filter to limit bandwidth per TCP connection

  26. nitgoy commented on Dec 4, 2021

    @nitgoy
    Contributor

    No, I only added http version. Doing it at network filter will require the high/low watermark capabilities in the network filter callbacks which I believe are not currently exposed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/connectionenhancementstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions