[erlang-questions] Limit the Network Bandwidth per application

Vans S vans_163@REDACTED
Sun Jan 1 18:17:24 CET 2017


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 <frank.muller.erl@REDACTED> 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 <jesper.louis.andersen@REDACTED> 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 <frank.muller.erl@REDACTED> 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
>>
>>
>>erlang-questions@REDACTED
>>
>>
>>http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>>
>
>

_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://erlang.org/mailman/listinfo/erlang-questions



More information about the erlang-questions mailing list