You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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?
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.
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.
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.
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.
@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.
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?
@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.
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.
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.
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.
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.
Activity
[-]how to configuration bandwidth limit[/-][+]how to config bandwidth limit[/+]htuch commentedon Oct 16, 2020
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.
tonya11en commentedon Oct 16, 2020
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?
mattklein123 commentedon Oct 16, 2020
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.
chwetion commentedon Oct 19, 2020
client means downstream, it will call upstream(tomcat)'s upload file interface. @tonya11en
i think i want like this issue: #6551
chwetion commentedon Oct 19, 2020
is there any doc for this? @mattklein123
mattklein123 commentedon Oct 19, 2020
https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/fault_filter
htuch commentedon Oct 19, 2020
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.
mattklein123 commentedon Oct 19, 2020
Agreed
chwetion commentedon Oct 20, 2020
@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
htuch commentedon Oct 20, 2020
@chwetion not that I know of, I suggest opening a tracking issue (or converting this issue into that).
2 remaining items
nitgoy commentedon Nov 18, 2020
@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.
tonya11en commentedon Nov 18, 2020
I don't think anyone has started on this yet. How do you imagine the proto config should look?
nitgoy commentedon Nov 19, 2020
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?
tonya11en commentedon Nov 19, 2020
@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.
nitgoy commentedon Nov 19, 2020
Sure, here you go: #14096
nitgoy commentedon Dec 16, 2020
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.
github-actions commentedon Jan 15, 2021
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.
github-actions commentedon Jan 22, 2021
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.
extensions: add http bandwidth limit filter (#16358)
extensions: add http bandwidth limit filter (envoyproxy#16358)
shou1dwe commentedon Oct 21, 2021
Is there a TCP flavor of this available? a filter to limit bandwidth per TCP connection
nitgoy commentedon Dec 4, 2021
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.