Linux Shell Speed/Bandwidth Limit

1

I use Debian 6 - 64bit and I've been using "trickle" for limiting my download/uploads speed on different kinds of programs like "wget" or "ftp". But now I want to reduce speeds for different kinds of network scripts. They are basically files that run as:

./Executable.script

I tried using trickle on this but it didn't limit the speed as I checked through iftop, although it didn't give an error as well.

trickle -u 1000 ./Executable.script 
# Didn't work

The script is basically a status script that would check status of different network applications and they would then reply with the result. The upload is what matters here. How should I limit this?

Asad Moeen

Posted 2013-08-10T14:23:12.040

Reputation: 357

Answers

1

If your script is using application/tool/command that uses fork, then trickle is of no use. In that case you have two options IMO:

1) rewrite your script to be comaptible with trickle shaping mechanism. no forking.

2) if you can define specific rules by source/dest ip/port of the traffic your script is generating, then you would find tc command quite useful. take a look a samples here

vahidne

Posted 2013-08-10T14:23:12.040

Reputation: 36

Our programmers wrote the script long ago so I don't know if it forks. I cannot share the exact script but it's based on this udp flood script: http://paste.ubuntu.com/5970370/

– Asad Moeen – 2013-08-10T16:02:16.693

1I appreciate the use of tc/iptables though but that would kill my purpose by limiting everything. I only need it on specific script and further more, specific things I run on that script. – Asad Moeen – 2013-08-10T16:08:07.787

iptables/tc would not get in the way of other communications, IF, you can define a rule based on ip/port for example to match your traffic. – vahidne – 2013-08-12T11:10:13.990

I would be more interested in getting the script to work with trickle. – Asad Moeen – 2013-08-13T09:58:21.717