Web Hosting Talk







View Full Version : Limiting BW in Linux


RackMy.com
08-07-2002, 05:45 PM
I need some help and am not sure if it is even possible. Is there a way to limit bandwidth on a Linux server?

Thanks for any suggestions!

mdrussell
08-07-2002, 06:10 PM
I assume your looking to limit bandwidth per domain? If you're running Apache, there are a number of modules that acheive this (in different ways). Check out mod_bwlimited, mod_throttle and mod_limit.

Matt

RackMy.com
08-07-2002, 06:13 PM
As you can tell, I am not a Linux person :) I am helping out a friend and he is using webmin. Can someone point me in the right direction? I did not see any of these, mod_bwlimited, mod_throttle and mod_limit?

Yes, it's for one domain/ip that we want to limit.

THANKS!

citrus
08-07-2002, 06:18 PM
I know mod_throttle is located here: http://www.snert.com/Software/mod_throttle/

Sorry, don't know about the others...

mdrussell
08-07-2002, 06:19 PM
Details on mod_throttle can be found at http://www.bigrock.com/~mlovell/throttle/

It's probably the best option for what you want to do...

A quick search on TLDP also found this:
http://tldp.org/HOWTO/Apache-Overview-HOWTO-5.html

As a general rule, if you can do it on Windows, Linux can do it twice as good :D

Brian S
08-08-2002, 02:00 AM
If I remember correctly, I beleive Snert.com's mod_throttle succeeded Lovel's older mod_throttle.

Brian

RackMy.com
08-15-2002, 12:45 PM
Ok, got mod_throttle installed, but am not sure how to set it up in httpd.conf. I tried what was listed, but kept getting an error. Ideas?

Thanks!

Antiarc_PHX
08-15-2002, 12:51 PM
How about giving us the error?

RackMy.com
08-15-2002, 02:01 PM
Nevermind, got it working :)

Thanks to all!!!!

RackMy.com
08-26-2002, 05:13 PM
OK, I tought I had it working but I was wrong. I set-up the following policy in httpd.conf

<IfModule mod_throttle.c>
ThrottlePolicy Volume 1M 1m
ThrottleRefresh 60

<Location /throttle-status>
SetHandler throttle-status
</Location>

<Location /throttle-client-ip>
SetHandler throttle-client-ip
</Location>

<Location /throttle-me>
SetHandler throttle-me
</Location>

<Location /~*/throttle-me>
SetHandler throttle-me
</Location>
</IfModule>

It is running because this is what I get on the status page:

% - 14184
Hits - 13302
Refused - 0
KBytes sent - 145250
KBytes per hit - 10
Delay (<=30) - 0
Policy - Volume
Limit - 1M
Period - 1m
Period Elapsed - 8.08
Idle Time - 0

Any ideas on where I am going wrong?

Ahmad
08-26-2002, 07:36 PM
As a side note, if you are giving your client a dedicated IP, you can have an IP level limit using iptables. This might be more accurate, because it can calculate HTTP, mail, FTP and any other application that binds to the users IP address.

RackMy.com
08-26-2002, 09:00 PM
Can you give me more info on how?

RackMy.com
08-27-2002, 10:50 AM
Anyone?

DigiCrime
08-27-2002, 02:12 PM
Ahmad you talkin about how traffic should be classified? like
Mark ALL packets as 0x03. This places all packets, by default, into the lowest priority queue.

Mark ICMP packets as 0x00. Mark all packets that have a destination port 1024 or less as 0x01.... etc etc ? I remember reading something about this the other day

Ahmad
08-27-2002, 07:00 PM
Sorry I didn't notice the replies.

No, that was a different thing. What I'm talking about here is IP accounting, about which I don't know a lot.

Try chapter 10 "IP Accounting" in "Linux Network Administrators Guide" (An oreilly book available online):

http://www.oreilly.com/catalog/linag2/book/ch10.html

goodness0001
08-27-2002, 07:07 PM
I am also reminded of this thead:
http://www.webhostingtalk.com/showthread.php?s=&threadid=35257&highlight=modthrottle

RackMy.com
08-27-2002, 08:27 PM
All these Linux experts and no one can solve my problem :)

DigiCrime
08-27-2002, 09:17 PM
I am no linux expert by anymeans, but searching the net
this is what i came up with if you want to read it. Wish I could help more

http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Bandwidth-Limiting-HOWTO.html

advantagecom
08-27-2002, 11:01 PM
http://www.etinc.com

Nice bandwidth control and accounting system. Can be installed on a server or as a network appliance.

Just make sure you can follow directions and know how to recompile a kernel. The guy that runs the place can difficult to work with at times, even after you've paid for the product and an update subscription.

Ahmad
08-28-2002, 09:59 AM
Originally posted by RackMy.com
All these Linux experts and no one can solve my problem :)

LOL.

I know a couple of people that can answer ANY linux question. But haven't seen any of them for a while.

I'm still learning Linux. :)

RackMy.com
08-29-2002, 02:02 AM
I am kind of shocked that no one can help. I quess if it's not a control panel option.... :)

Ahmad
08-29-2002, 03:29 AM
You can try forums dedicated to Linux. The situation will be completely different. ;)

RackMy.com
09-04-2002, 01:01 PM
Last call of help, anyone have any ideas? And I thought Linux was better that Windows (prod, poke, :))

Ahmad
09-05-2002, 12:34 AM
Originally posted by RackMy.com
..
And I thought Linux was better that Windows (prod, poke, :))

grrrr :angry:



:)