Web Hosting Talk







View Full Version : Bandwidth Limitation


FunnyFo
02-10-2003, 02:26 AM
Hi all,
I'm total idiot where it comes to hosting... so bare with me :stickout:

I got a server lately from colo ... main purpose of the server is to upload/download... so I have 2 methods of doing so "FTP, HTTP"

Now... the problem is since I started the HTTP download... the transfer rate of the FTP went down and sometimes it keep disconnecting.

My question is: how can I divide the bandwidth use and limit for the HTTP so the FTP won't be effected even if there will be high demand on the apache ??

PLEASE HELP... :blush:

eddy2099
02-10-2003, 02:46 AM
FunnyFo,

In the past, we did provide both HTTP and FTP download methods but gave up anonymous FTP downloads because it was too intensive for the server. The HTTP downloads seems to be able to handle more traffic.

As to your question, there is basically one path In or Out of your server to the internet. It is like a road, you can have only so many vehicles running on each at each time. If it is has a little more cars, there might be traffic jams which would cause the maximum speed to fall.

For instance, in simplistic terms, if you have a 10mbps bandwidth, and you have 1 user, that user can download a max of 10mbps, but if you have 10 users, each will get only a max of 1mbps. I know it doesn't quite work that way but you get the idea.

How drastic is the fall in speed ?

My advise is to do a solely http download and you will have a better performance.

What is the specification of the server and how many simultaneous transfers are there ?

FunnyFo
02-10-2003, 02:54 AM
First of all thanx for replying... I fogot to mention that I use Webmin as control panel...


Specification of the server:

RedHat Linux 8.0, FreeBSD 4.7, Debian or Slackware.
Processor: Intel Pentium IV 2.0GHz w/512K Cache.
Memory: 1GB ECC SDRAM.
Hard Drive: 220 GB EIDE 7200RPM.
Control Panel: Webmin Server Administrator


well I know that HTTP can handle the traffic better than FTP but the files store is in FTP... I just can't open 140 GB of files out to public... it will suck the bandwidth in no time.

I'm just offering some files in rotation... and the drop of speed was like 200% (from 40KB to 10 or less sometimes)

eddy2099
02-10-2003, 03:18 AM
I guess there is nothing much you could do apart from using a lighter weight such as pure-ftp or something.

4PSA
02-10-2003, 02:29 PM
In order to limit bandwidth per IP, use HTTP and configure apache with mod_throttle.

kicker
02-10-2003, 02:35 PM
Originally posted by 4PSA
In order to limit bandwidth per IP, use HTTP and configure apache with mod_throttle.

Mod_Throttle doesn't work well with large files. You end up with a sinusoidal behavior. Better to use bandwidth shaping in the Linux Kernel on port 80.

4PSA
02-10-2003, 02:45 PM
An how will you be able to limit the bandwidth per user?

kicker
02-10-2003, 04:44 PM
Originally posted by 4PSA
An how will you be able to limit the bandwidth per user?

My mistake. If you want to limit the number of connections/per unit of time/per user use mod_throttle. If you want to limit the total bandwidth usage of the server use linux kernel bandwidth shaping.

FunnyFo
02-11-2003, 01:56 AM
If you want to limit the total bandwidth usage of the server use linux kernel bandwidth shaping.

:blush: could you please tell me how to do that ?? If it is possible to do it using Webmin, that would be much appreciated :rolleyes:

4PSA
02-14-2003, 02:14 PM
It's not possible to do it with Webmin, but you can read this article:
http://linux.oreillynet.com/pub/a/linux/2000/08/24/LinuxAdmin.html

kicker
02-14-2003, 03:02 PM
http://lartc.org/howto/lartc.qdisc.classless.html#AEN678

tc qdisc add dev eth0 root tbf rate 10mbit latency 50ms burst 1540

This command should rate limit your eth0 interface to 10Mb/s. It has to be run each time your machine reboots so put it in rc.local or in your startup scripts.

But be warned! This script will limit *all* outbound packets (even ssh) when you hit the limit. If you simply want to limit a single port you need to do some more complex filtering/limiting.