HTB Advanced Config

I have a gentoo distribution kernel 2.4.22 , with latest patch to htb and newest tc executable.
I have a 256kbps bandwidth and i wish to limit with htb clients like 32kbps or 64kbps.
I did that but the problem is that the web pages load very solw. The loading has a big delay.
I i download a file it downloads exactly at the limited speed but the web pages load with a high delay. How do i prioritze web pages before all else in each class of clients ?

Thanks
-Mihai-Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

-Mihai-Author Commented:
Also can i priorize certain traffic on certain ports ?
0
SmudoCommented:
Sure, you can priorize traffic on certain ports. You first must mark the packets with iptables:

iptables -t mangle -A TRAFFIC-SHAPING -p tcp --dport 80 -j MARK --set-mark 10

That will queue all packets with dport 80 in class 10. (which you can give the highest priority if necessary)

Here the whole example:

iptables -t mangle -A TRAFFIC-SHAPING -p tcp --dport 80 -j MARK --set-mark 10
iptables -t mangle -A TRAFFIC-SHAPING -s CLIENT1 -j MARK --set-mark 11
iptables -t mangle -A TRAFFIC-SHAPING -s CLIENT2 -j MARK --set-mark 12

tc qdisc add dev eth0 root handle 1: htb default 13
tc class add dev eth0 parent 1: classid 1:1 htb rate 256bit ceil 256kbit

tc class add dev eth0 parent 1:1 classid 1:10 htb rate 10kbit ceil 20kbit prio 0 (don't think that HTTP requests need more :)
tc class add dev eth0 parent 1:1 classid 1:11 htb rate 32kbit ceil 64kbit prio 1 (clients with 32/64kbit permission)
tc class add dev eth0 parent 1:1 classid 1:12 htb rate 64kbit ceil 128kbit prio 2 (clients with 64/128bit permission)
tc class add dev eth0 parent 1:1 classid 1:13 htb rate 50kbit ceil 256kbit prio 3 (DEFAULT class)

tc filter add dev eth0 parent 1:0 prio 1 protocol ip handle 10 fw flowid 1:10
tc filter add dev eth0 parent 1:0 prio 2 protocol ip handle 11 fw flowid 1:11
tc filter add dev eth0 parent 1:0 prio 3 protocol ip handle 12 fw flowid 1:12
tc filter add dev eth0 parent 1:0 prio 4 protocol ip handle 13 fw flowid 1:13

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
snedelchevCommented:
http is burst traffic
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 10kbit ceil 20kbit  burst 10kbit prio 0
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.