[LINUX] Bandwith Limit with Trickle

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

[LINUX] Bandwith Limit with Trickle

Post 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
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [LINUX] Bandwith Limit with Trickle

Post 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).
:idea: Please read the FAQ and How to Request Help.
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: [LINUX] Bandwith Limit

Post by plittlefield »

Would this work in FileBot?

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

Regards,

Paul
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [LINUX] Bandwith Limit with Trickle

Post 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.
:idea: Please read the FAQ and How to Request Help.
plittlefield
Posts: 101
Joined: 09 Mar 2014, 19:15

Re: [LINUX] Bandwith Limit with Trickle

Post by plittlefield »

Okay, fair enough.
Post Reply