Thanks... now it works :DDD
I've down my rate to 100kbit
I'll try to tune my numbers now
editing -- now that is working I will show here my gentoo configuration.... Thanks again PaulBredbury,
The idea is making torrents get the lower priority over everything..
Note that my interface user here is eth2, you should change it to your inferface... I'm using transmission-daemon,
so I can (with my route in dmz) access it web based interface from work and put new torrents do download
If you have not it installed you should install right now.. or you can adapt this solution for another client..
I have a 1mb band of internet.. you may change number to fit your speed
First I create two simple scripts, containing the QOS rules, I let it on /root for a while.. I'm a lazy guy...
/root/tc2.sh
Code: Select all
#!/bin/bash
test -z $1 && { echo "No interface, use: $0 <interface>"; exit 1; }
tc qdisc add dev $1 root handle 1: htb default 10
tc class add dev $1 parent 1: classid 1:1 htb rate 100kbit
tc class add dev $1 parent 1:1 classid 1:10 htb rate 50kbit ceil 100kbit prio 0
tc class add dev $1 parent 1:1 classid 1:20 htb rate 50kbit ceil 100kbit prio 1
/root/tc2del.sh
Code: Select all
#!/bin/bash
test -z $1 && { echo "No interface, use: $0 <interface>"; exit 1; }
tc qdisc del dev $1 root handle 1: htb
Grant execution permission to that scripts..
Then I create a new init script, copy pasting from a sample, sure;;
/etc/init.d/qos-rules
Code: Select all
#!/sbin/runscript
interface=eth2
depend() {
# the daemon needs the internet to function
need iptables
need net
}
start() {
ebegin "Starting QOS Rules"
/root/tc2.sh $interface
eend $?
}
stop() {
ebegin "Stopping QOS Rules"
/root/tc2del.sh $interface
eend $?
}
de
Grant execution permission here too
Create iptables rules
Code: Select all
iptables -t mangle -A POSTROUTING -m owner --uid-owner transmission -j CLASSIFY --set-class 1:20
iptables -t mangle -A POSTROUTING -m owner --uid-owner transmission -j RETURN
Save it
Make transmission use transmission user.. I don't know if this is made by default.. can any one confirm?
Edit /etc/conf.d/transmission-daemon and let runas_user variable as transmission
Put everything on default level
Code: Select all
rc-update add iptables default
rc-update add qos-rules default
rc-update add transmission-daemon default
Start everything, if not yet started
Code: Select all
/etc/init.d/qos-rules start
/etc/init.d/iptables start
/etc/init.d/transmission-daemon start
Test,
Go to localhost:9091, on your browser.. put some fine seeded torrents do download and wait for transmission get band
Go to ftp.kernel.org and start a kernel download.. this is what I use
You may see torrents speed falling down and download speed going up[/quote]
Cheers