LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-11-2009, 06:57 AM   #1
loco41211
LQ Newbie
 
Registered: Aug 2009
Posts: 3

Rep: Reputation: 0
Question How can I monitor and limit bandwidth? Read description on first post for detailed Q.


I have looked all over the place and from the advice of others I have come to the conclusion it would be best to use iptables for this.

The problem:
I have a dedicated server running debian. On this server I want to run torrent clients. Which one to use I don't mind at all, as long as it meets the requirements. What I want is:
  • To monitor diskspace used per user (many possible solutions for this)
  • To monitor the bandwidth used per user (what I am stuck on!)
  • Once this bandwidth threshold (example 250GB total traffic) is hit, another script is triggered.

On the current set up, for each user who has access to the client a unix account is created. This account starts it's own torrent client relative to the user and the userdir. Using quota the disk space usage can be tracked and limited.

How would I go about tracking the monthly traffic (outgoing and incoming) per user (or per process by pid number?). There must be some way to do this... I can't work it out, and it might be since my iptables knowledge isn't the greatest!

Possible solutions so far:Will be updated as we go along
  • The idea posted by a user here: LINK But I need help on setting something like that up. Password for link is
    Quote:
    ewok.adventure



If you have any ideas please let me know, I will be tracking this topic as I need to solve this asap... Thanks in advance!

Last edited by loco41211; 08-11-2009 at 07:45 AM.
 
Old 08-11-2009, 07:33 AM   #2
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Rep: Reputation: 66
Marking packet using iptables and using tc for traffic control can help you in this way. For beginner reference in this direction visit www.linuxinterviews.blogspot.com.

Thanks
 
Old 08-11-2009, 07:39 AM   #3
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
If the post from vishesh does not take you far do a google search for
"linux traffic control" this should get you far.


Anyways the link you provided needs a password. bummer.
 
Old 08-11-2009, 07:44 AM   #4
loco41211
LQ Newbie
 
Registered: Aug 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by zhjim View Post
Anyways the link you provided needs a password. bummer.
Damn I forgot they password protected the site... had a little argument with them about that because they moved my question after I got answers without giving me a password for it. Anyway, the password to get to it is:
Quote:
ewok.adventure
 
Old 08-11-2009, 07:45 AM   #5
chitambira
Member
 
Registered: Oct 2008
Location: Online
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 51
if user := ipaddr; then
http://bandwidthd.sourceforge.net/
else
put server behind proxy and use proxy stats
or go the QoS way

Last edited by chitambira; 08-11-2009 at 07:50 AM.
 
Old 08-11-2009, 07:46 AM   #6
loco41211
LQ Newbie
 
Registered: Aug 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by vishesh View Post
Marking packet using iptables and using tc for traffic control can help you in this way. For beginner reference in this direction visit www.linuxinterviews.blogspot.com.

Thanks
tc only allows shaping such as how many max kb/s to allow. I want to limit the total traffic up to a set threshold which gets cleared at the end of every calendar month. Thanks for the suggestion

EDIT:
chitambira: I noticed bandwidthd before, but that only allows monitoring of the overall network interface (or just traffic to/from a single IP. All clients are on the same IP though...) and not an individual process or all processes owned by a user.

Last edited by loco41211; 08-11-2009 at 07:54 AM.
 
  


Reply

Tags
bandwidth, limit, linux



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
i want to know detailed description of linux pipes, filters and streams. navneet88 Linux - Newbie 2 03-29-2009 09:19 AM
Limit Bandwidth as Data Volume Approaches Limit sweno Linux - Server 1 06-12-2008 07:10 AM
distro-independent detailed description of linux installation process kabarbaik Linux - General 1 02-20-2007 11:16 AM
Vsftpd - how to limit download bandwidth but unlimited upload bandwidth? mpls mikeg Linux - Software 3 08-13-2005 01:52 PM
Radeon 7500 TV-Out (detailed post) hairston4 Linux - Hardware 0 08-01-2003 01:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:51 AM.

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