Skip to contentSkip to conversation

Service Loading

LARTC Steve 2 participants 2 messages Oct 7, 2001 – Oct 12, 2001

lore
Share & tools
lore

Steve

author
#0 lore raw

Hi,

My apologies if I've just missed the point here (I have scanned the archives).

I have a server with an FTP service on one IP, a HTTP service on the other. I wish to make all the upstream bandwidth available for FTP unless an HTTP request arrives - at which point I want to throttle FTP back and give the majority of the bandwidth to the HTTP session.

In order to test this I have the following script (I'm sure I've just missed the point somewhere along the line):-

tc qdisc del dev ppp0 root
tc qdisc add dev ppp0 root handle 10: cbq bandwidth 10Mbit avpkt 1000

tc class add dev ppp0 parent 10:0 classid 10:1 cbq bandwidth 10Mbit rate \
128kbit allot 1514 prio 1 maxburst 20 avpkt 1000

tc class add dev ppp0 parent 10:1 classid 10:2 cbq bandwidth 10Mbit rate \
10kbit allot 1514 prio 8 maxburst 20 avpkt 1000

tc filter add dev ppp0 parent 10:0 protocol ip pref 60 u32 \
match ip dst 0.0.0.0/0 flowid 10:1

tc filter add dev ppp0 parent 10:0 protocol ip pref 50 u32 \
match ip src my.ftp.server flowid 10:2

As I understand it 10:2 is a child of 10:1. As I have set the priority of 10:2 to 8 and the priority of 10:1 to 1 then a request meeting 10:1 will have a much higher priority and the bandwidth will all be assigned to the 10:1 session and not loan any bandwidth to 10:1.

In reality this doesnt work! If I make 10:2 bounded then it throttles back to 10kbs. If I remove bounded it borrows bandwidth from its parent
- even at the cost of a 10:1 session.

Comments as to :-

a) why this doesn't work
b) whether this is the best way of handling this problem

....will be greatly appreciated!

With thanks,

Steve.

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/

#1 lore raw
Quoted 4 lines · Steve

Hi,

My apologies if I've just missed the point here (I have scanned the archives).

I missed a small point. I will try to explain. When you provide no weight parameter and you use no extraq qdiscs and you put on each class a filter, class 10:1 and 10:2 will get each 50% of the bandwidth. Don't ask me why.

Give each class a weight parameter, create an extra class attached to the root qdisc, attach the 2 other class to this class and point the filters direcly to each class. You find a lot of examples and more explanation on docum.org.

Stef

Signature · 7 lines
[email protected]        [email protected]
More QOS info : http://docum.org/
Title : "Using Linux as bandwidth manager"

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/