Page 1 of 1

[LINUX] Bandwith Limit with Trickle

Posted: 01 Jul 2018, 12:02
by plittlefield
Hello everyone,

I am trying to use the TCP bandwidth control software called TRICKLE (https://manurevah.com/blah/en/p/trickle-bandwith-shaper) to control how much of my internet download is used when using FileBot.

The script I wrote runs FileBot on a SSHFS mounted filesystem from my seedbox in another country.

The command I run to limit the download bandwidth to 128K

Code: Select all

/usr/bin/trickle -d 128 /usr/bin/filebot -script /home/paully/.filebot/scripts/amc_.groovy --output "/home/paully/Plex" etc
It runs but but when I look at the Linux process tree, trickle is not running at all and Java seems to be the main process.

Java CAN use trickle because it had the libc stack...

Code: Select all

ldd /usr/bin/java
        linux-vdso.so.1 =>  (0x00007ffc94dfc000)
        libjli.so => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1cbf191000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f1cbf561000)
How can I get the extra command '/usr/bin/trickle' in the /usr/bin/filebot when Java is called?

Does anyone else use trickle or is there a clever add-on or switch for FileBot to limit TCP bandwidth?

Thanks in advance,

:-)

Paully

Re: [LINUX] Bandwith Limit with Trickle

Posted: 01 Jul 2018, 12:48
by rednoah
1.
You could run a local proxy server that throttles bandwidth, and then have all your apps connect through that: https://vinusumi.wordpress.com/2016/07/ ... uid-proxy/


2.
FileBot / Java do not have an easy way to throttle IO bandwidth. How did you confirm that trickle indeed works with java processes? Java is basically an entire OS in itself, with it's own network stack, so there's a good chance it's not using the libc TCP stack at all.

Note that /usr/bin/filebot just links to a shell script that in turn executes java. Modifying filebot.sh and putting trickle -d 128 right before the java call might work (assuming that java is using libc for TCP on Linux).

Re: [LINUX] Bandwith Limit

Posted: 21 Nov 2018, 23:03
by plittlefield
Would this work in FileBot?

https://github.com/lucabox/Java-BandwidthLimiter

Regards,

Paul

Re: [LINUX] Bandwith Limit with Trickle

Posted: 22 Nov 2018, 07:32
by rednoah
Unfortunately, no. Support for bandwidth limits in the application layer is not planned (as it would be extremely difficult to actually make work well on this layer of abstraction).

Using network layer tools, such as VPNs, or Proxies, or switches / routers with bandwidth limit features is generally recommended.

Re: [LINUX] Bandwith Limit with Trickle

Posted: 22 Nov 2018, 07:58
by plittlefield
Okay, fair enough.