Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-28-2006, 01:48 AM   #1
Registered: Mar 2005
Posts: 141

Rep: Reputation: 15
Apache bandwidth limiting?

I have a debian server running apache 1.33 that I host several of my own websites on. As a favor I agreed to host a site for a friends online gaming guild, since I have the server colocated on a 3mbit circuit. Normal traffic to that site and forums is no problem, however fairly regularly people upload 30 - 50mb videos for sharing. The ensuing traffic kills me bandwidth wise, and pushes me into a higher bandwidth bracket than I'm contracted for. If they don't post videso it's well under my contracted amount and costs me nothng extra, but when they do post them it can easily cost me an extra $100 or more for the bandwidth.

I've already asked them to ask people to not post videos, but inevitably every month or two some numbnuts does it, and I'm tired of it hitting my pocket book.

Is there any way in Apache to limit bandwidth to a certain site (I'm using the Virtual Host directive, but the site has it's own legit IP atm), either in the kb/sec or GB/mo catagory?
Old 11-29-2006, 07:02 AM   #2
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
If you want to deny serving video then limiting bandwidth IMHO is akin to suppression of symptoms instead of prevention of the cause. One suggestion could be to 1) deny uploading files with a size over n MB and a list of known extensions, 2) ask them to dump those files on a free image hoster and only post links on the board, 3) use mod_security to deny requests for certain extensions, or 4) regularly purge movies from the database. These aren't hassle free: #1 uploads can not be checked if they're POSTed until they're on the FS in a tempfile AFAIK and it may require adapting the upload mechanism to include checks, #2 requires user discipline which is decidedly weak, #3 can only work if the request can be trapped and #4 asserts the movie was uploaded, wasting bandwidth already. Whichever method you choose, if you allow movies to be uploaded you'll be wasting bandwidth, serving it or not.

If you want bandwidth limiting through Apache a quick search of teh intarweb shows modules with names like mod_curb, mod_bandwidth, bw_mod and mod_cband.

If you want to block HTTP traffic after reaching a threshold you could also search and for bandwidth accounting applications.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bandwidth Limiting signature16 Linux - Software 4 05-21-2006 03:53 PM
bandwidth limiting gubak Linux - Networking 1 03-02-2005 06:51 AM
Limiting the amount of bandwidth Apache Uses wenberg Linux - Software 0 02-07-2005 11:39 AM
Bandwidth Limiting UnrealTear Linux - Software 2 04-10-2004 10:33 PM
Bandwidth limiting dunkyb Linux - Networking 3 09-17-2003 04:36 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:44 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration