Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 87241 invoked from network); 8 Dec 2009 08:19:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Dec 2009 08:19:59 -0000 Received: (qmail 98662 invoked by uid 500); 8 Dec 2009 08:19:59 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 98603 invoked by uid 500); 8 Dec 2009 08:19:58 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 98593 invoked by uid 99); 8 Dec 2009 08:19:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 08:19:57 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sorinm@gmail.com designates 209.85.220.216 as permitted sender) Received: from [209.85.220.216] (HELO mail-fx0-f216.google.com) (209.85.220.216) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Dec 2009 08:19:54 +0000 Received: by fxm8 with SMTP id 8so4286291fxm.27 for ; Tue, 08 Dec 2009 00:19:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=Mqu7uNi3dyNrRqec4fGbJwsaaUqvtqDzgbg2bLGVZVk=; b=md9WhV4pjR6hvYXRMBUVlLxLge6p6QvJbelsLAwf9zasGc2ncUJW1fZzvsNovfAAPz Qb/EqDl2Jy+hx5tQqngKlbFmbWMhHExC9M3NIPps8NHK4JgPiyKTUmbWUuRGTnnMe6x2 I+NgziDmc5IkRraJndGWAxrx9AS2eh3HqEJGQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=jum6wVVDiTeKnFp0/WnP8M0rRsqsGvi0K6ApYLbYEHvUFTzUBL5F+Wx31ZprXSTB+/ xjGl2jruEZjBc4wd8Xn2CwEbSRbPacH0oNtW6gP7LU3gU7vpAy+eh+SPwUGFEfnfTRXC 8l0djfOLpqqc25kHVFg44pJ5skrz/zy2XNF5c= MIME-Version: 1.0 Received: by 10.102.197.11 with SMTP id u11mr663684muf.75.1260260372900; Tue, 08 Dec 2009 00:19:32 -0800 (PST) In-Reply-To: <26688437.post@talk.nabble.com> References: <26688437.post@talk.nabble.com> Date: Tue, 8 Dec 2009 09:19:32 +0100 Message-ID: <20170a030912080019k14bf4229r48067a2369521980@mail.gmail.com> Subject: Re: Bandwith limit/per user from mysql From: Sorin Manolache To: modules-dev@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 On Tue, Dec 8, 2009 at 05:11, partysoft wrote: > > I am looking for a solution to limit the bandwith for the users of a site > that have access to some mp3 / subscription. I don't want to serve files > through PHP, but directly with some apache module.. > do i have to count every bit? or how this should be handled. I have all the > info on a mysql DB. > Thank you so much for your replies. This kind of functionality, in my opinion, is better implemented at transport level and not at application level. I've done something similar, but more primitive, i.e. the cumulated bandwidth of all connections to port 80 was capped, using traffic shaping in the linux kernel. The network packets are classified with iptables and then each class can be given a different queueing policy with tc. Check http://lartc.org/howto/, chapter 9. I didn't do it per user, but I suppose one can easily do it per client IP address. I admit that maybe this approach is not suitable when you identify users with some data token at application level. S