[erlang-questions] Limit the Network Bandwidth per application

Frank Muller <>
Sun Jan 1 18:39:34 CET 2017


Hi Vans,

I first found "tc" and after bit of thinking what I would like to achieve
is much more simpler.

Control in/out TCP traffic to a backend server through an Erlang proxy.

Thank you for the links.

/Frank


Le dim. 1 janv. 2017 à 18:20, Vans S <> wrote :

> This is more difficult then it appears. The standard way is to use cgroups
> or window quotas (per user/process).
>
>
>
> The other way is to throttle at the interface level,
>
>
> https://www.cyberciti.biz/faq/linux-traffic-shaping-using-tc-to-control-http-traffic/
> .
>
>
>
> Yet another way is to use virtualization and set quotas on the
> container/vm.
>
>
>
> Yet another way is to mark the packets coming from your process so
> pf/iptables/tc/other can traffic shape it.
>
>
>
>
>
> Probably the most straightforward way is to simply count every call to
> send/recv in Erlang itself and count the amount of bytes sent/recv then do
> math.
>
>
>
>
>
> I would probably go for the cgroups or virtualization approach personally.
>
>
>
>
>
>
>
>
>
> On Sunday, January 1, 2017 11:30 AM, Frank Muller <
> > wrote:
>
>
>
>
>
>
>
> Thank you for the link Jesper.
>
>
>
> Actually, any TCP bandwidth limiting (upload, download) code will make it.
>
>
>
> I would like to learn how to implement such features in practice.
>
>
>
> /Frank
>
>
>
>
>
> Le dim. 1 janv. 2017 à 14:42, Jesper Louis Andersen <
> > a écrit :
>
>
>
> See https://github.com/jlouis/rlimit but mind you, there is an issue as
> well: https://github.com/jlouis/rlimit/issues/2 :)
>
> >
>
> >On Sat, Dec 31, 2016 at 9:57 AM Frank Muller <>
> wrote:
>
> >
>
> >Hi guys,
>
> >>
>
> >>I stumbled across trickle (https://github.com/mariusae/trickle), a
> user-land application bandwidth shaper.
>
> >>A very useful small piece of software as explained here:
>
> >>
> http://www.tecmint.com/manage-and-limit-downloadupload-bandwidth-with-trickle-in-linux/
>
> >>
>
> >>
>
> >>It relies on libevent (http://libevent.org/), and can be installed vi
> apt-get or yum.
>
> >>
>
> >>I’m wondering if one can create a trickle equivalent in Erlang (+NIF or
> whatever)?
>
> >>
>
> >>Feedbacks very appreciated (links to equivalent apps in Erlang,
> implementation ideas, etc).
>
> >>
>
> >>Thank you and happy new year.
>
> >>/Frank
>
> >
>
> >>
>
> >>_______________________________________________
>
> >>
>
> >>
>
> >>erlang-questions mailing list
>
> >>
>
> >>
>
> >>
>
> >>
>
> >>
>
> >>http://erlang.org/mailman/listinfo/erlang-questions
>
> >>
>
> >>
>
> >>
>
> >
>
> >
>
>
>
> _______________________________________________
>
> erlang-questions mailing list
>
> 
>
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170101/0e1b41d8/attachment.html>


More information about the erlang-questions mailing list