LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Traffic Control - Could use some feedback about its usage (https://www.linuxquestions.org/questions/linux-software-2/traffic-control-could-use-some-feedback-about-its-usage-4175538998/)

Foxhound 04-07-2015 08:49 AM

Traffic Control - Could use some feedback about its usage
 
I want to use TC on one of my servers. I have been reading a guide about how to use it: http://www.tldp.org/HOWTO/html_singl...Control-HOWTO/
But I am pretty novice (but trying hard to learn) to all this Linux stuff so before I actually totally fubar the server I hope people here with more knowledge about TC can tell me if my planned additions are ok.

This is for a server which is purely used to serve static files (rar,zip,exe etc).
The server has a 1GB port and I want to limit traffic on port 80 to 950MB/s so I can use the rest for other connections cause currently (I have a busy website) at peak hours the connection is fully used and makes it hard for me to, for example, connect to it using FTP to upload new files.
Also this server makes a DB connection to another server and when the 1GB is fully used there is no more room for the DB connection so users get a DB connection error.


There are no current rules as far as I can see cause tc -s qdisc ls dev eth0 outputs:
PHP Code:

qdisc mq 0root
 Sent 150251984620065 bytes 95518580 pkt 
(dropped 3321665overlimits 0 requeues 1185698136)
 
rate 0bit 0pps backlog 261995b 300p requeues 1185698136 

Now I want to add the following:
PHP Code:

tc qdisc add dev eth0 root handle 1:0 htb default 2
tc 
class add dev eth0 parent 1:0 classid 1:2 htb rate 962560kbps ceil 972800kbps prio 0
iptables 
-A OUTPUT -t mangle -p tcp --sport 80 -j MARK --set-mark 2 

I copied the above from another site which had a guide about TC and edited it to my needs.


I hope someone who knows TC is willing to check the above and let me know if I am on the proper path with my code. Or maybe tell me what I should change to make this work better.

Thanks in advance for the assistance! :)

Foxhound 04-10-2015 09:43 AM

Nobody has any tips or feedback regarding this?
I guess I will just have to try and see what happens :)

Thanks anyway!


All times are GMT -5. The time now is 08:15 PM.