[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Mldonkey-users] mldonkey and QoS
From: |
Alexander Gretencord |
Subject: |
Re: [Mldonkey-users] mldonkey and QoS |
Date: |
Fri, 6 Sep 2002 19:41:04 +0200 |
User-agent: |
KMail/1.4.2 |
On Friday 06 September 2002 16:20, Rainer Krauss wrote:
> I'm really not an expert in CBQ and what i got so far as demonstrations
> doesn't change a lot to my router with mldonky traffic. Has
> anyone got some rules/classes for iptable/CBQ to optimize traffic with
> mldonkey use (just as a client, no server)? Or at least some tips
> where to start from? (I've DSL 1024/128 kbit - i'm using debian woody
> with 2.4.18 kernel if that matters)
It does :) I shape my mldonkey too but I use HTB which is not yet in the
official kernel (will be in 2.4.20, is in since 2.4.10-presomething) but it
works great and is easier to setup. And with HTB you can have one class
borrow unused traffic from another class.
I've given mldonkey its own class which lives besides all the others. So my
setup of classes is like this:
1:1
/ | \
1:10 ... 1:31
with 1:31 being mldonkey traffic. As you can see all traffic can borrow from
the rest (if you can't read the user guide at
http://luxik.cdi.cz/~devik/qos/htb/manual/userg.htm). mldonkey gets less if I
have other traffic but can borrow unused traffic if it wants (up to a ceiling
I defined). You can also read the Advanced Routing Howto at
http://lartc.org/howto/ which is where I got more explanation of what the
adsl-bw-howto just does :)
My script is an adaption of the script in the ADSL-Bandwidth-Management Howto.
(I also use the RED queue for incoming traffic which works great but is not
in the official kernel either).
This is what mldonkey gets
tc class add dev ppp0 parent 1:1 classid 1:31 htb rate 1kbps ceil 10kbps \
burst 6k prio 3
This means mldonkey's rate is at 1kilobyte per second when my line is busy
doing other uploading stuff but can get up to 10K/sec if my bandwidth is
unused. The following attaches an sfq qdisc so mldonkey connections get
stochastic fairness (each connection from mldonkey gets its fair share of
that 1-10K/sec):
tc qdisc add dev ppp0 parent 1:31 handle 31: sfq perturb 10
To filter traffic into the right class I use iptables FWMARK support. The
following matches on mark 5 set by iptables in my firewall:
tc filter add dev ppp0 parent 1:0 protocol ip prio 2 \
handle 5 fw flowid 1:31
I set that mark for every packet that the mldonkey user creates. If you don't
have an mldonkey user you can match on proccess name too but I'd suggest you
make a user and run mldonkey under that user, its not just good for shaping.
This is the line from my firewall script:
iptables -t mangle -A OUTPUT -j MARK -m owner --uid-owner mldonkey \
--set-mark 5
Alex
--
"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
Benjamin Franklin