You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jason D <ja...@codepanzyz.com> on 2004/01/11 09:43:32 UTC

[users@httpd] bandwidth control - Part 2

Hello everyone,
    I posted a question about a week ago asking if anyone knows about
throttling bandwidth per month per VHOST to no avail. I see stats saying
that apache is running 60% of the web servers out there. But I can not find
any information on the ability to limit the amount of bandwidth used per
site per month. Seeing as how 99% of web hosting companies charge this way
and 60% of the web is run on apache, does this mean that none of the apache
sites are limiting bandwidth usage in this manor? That is somewhat of a
rhetorical question / rant due to frustration of not being able to educate
myself on how to limit bandwidth with apache 2.x. But really what is being
used to enforce the limits put into place at the point of sale with
commercial web hosting sites running apache? I know that out of that 60%
Does anyone on this list use apache to host sites with bandwidth
limitations?
          Thanks,
             Jason


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] bandwidth control - Part 2

Posted by Jason D <ja...@codepanzyz.com>.
Ok guys,
   Thanks for the tips on " mod_bwlimited and mod_log_bytes and CPanel and
Plesk " that sould give me something to research for a while. See if any of
this will work on my setup. I guess apache 2.x is still not ready for
production level servers. I did not start messing around with apache untill
after 2.x was released. I guess I should have looked at what the differences
were before jumping at the bigger version number seeing as how most tips
point to 1.3 ;-)
   Thanks again,


 ----- Original Message ----- 
From: "Brian Dessent" <br...@dessent.net>
To: <us...@httpd.apache.org>
Sent: Sunday, January 11, 2004 1:01 AM
Subject: Re: [users@httpd] bandwidth control - Part 2


> Jason D wrote:
>
> >     I posted a question about a week ago asking if anyone knows about
> > throttling bandwidth per month per VHOST to no avail. I see stats saying
> > that apache is running 60% of the web servers out there. But I can not
find
> > any information on the ability to limit the amount of bandwidth used per
> > site per month. Seeing as how 99% of web hosting companies charge this
way
> > and 60% of the web is run on apache, does this mean that none of the
apache
> > sites are limiting bandwidth usage in this manor? That is somewhat of a
> > rhetorical question / rant due to frustration of not being able to
educate
> > myself on how to limit bandwidth with apache 2.x. But really what is
being
> > used to enforce the limits put into place at the point of sale with
> > commercial web hosting sites running apache? I know that out of that 60%
> > Does anyone on this list use apache to host sites with bandwidth
> > limitations?
>
> CPanel and Plesk do this, and they are the most popular webhosting
> front-ends.  I think CPanel essentially creates a 'transfer' log for
> each vhost, which logs simply the time and # of bytes for each request.
> I think at some frequency there's some process that sums these logs and
> handles the accounting.  When a vhost goes over its limit, further
> requests generate a 500 error code with a short "Over bandwidth" error.
> It also uses some Apache modules.  If you look at the server signiture
> of a host that's running CPanel, you'll see something like:
>
> Server: Apache/1.3.29 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2
> mod_bwlimited/1.4 PHP/4.3.4 FrontPage/5.0.2.2634 mod_ssl/2.8.16
> OpenSSL/0.9.6b
>
> You should google for mod_bwlimited and mod_log_bytes, but I believe one
> or both of them are CPanel-proprietary.  One problem googling for these
> is that you are going to get piles and piles of random people's <?
> phpinfo() ?> pages.  You'll probably want to add "-phpinfo" and some
> other negative keywords to your google query to restrict the search.
>
> But, if you're using 2.x then I think the chances of finding a module to
> do this go way down, and so you'll be back to the method of keeping
> transfer logs and a periodic cron job to do the summing.
>
> Brian
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] bandwidth control - Part 2

Posted by Jez Hancock <je...@munk.nu>.
On Sun, Jan 11, 2004 at 01:01:16AM -0800, Brian Dessent wrote:
> Jason D wrote:
> 
> >     I posted a question about a week ago asking if anyone knows about
> > throttling bandwidth per month per VHOST to no avail. I see stats saying
> > that apache is running 60% of the web servers out there. But I can not find
> > any information on the ability to limit the amount of bandwidth used per
> > site per month. Seeing as how 99% of web hosting companies charge this way
> > and 60% of the web is run on apache, does this mean that none of the apache
> > sites are limiting bandwidth usage in this manor? That is somewhat of a
> > rhetorical question / rant due to frustration of not being able to educate
> > myself on how to limit bandwidth with apache 2.x. But really what is being
> > used to enforce the limits put into place at the point of sale with
> > commercial web hosting sites running apache? I know that out of that 60%
> > Does anyone on this list use apache to host sites with bandwidth
> > limitations?
> 
<snip>
> 
> Server: Apache/1.3.29 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2
> mod_bwlimited/1.4 PHP/4.3.4 FrontPage/5.0.2.2634 mod_ssl/2.8.16
> OpenSSL/0.9.6b
> 
> You should google for mod_bwlimited and mod_log_bytes, but I believe one
> or both of them are CPanel-proprietary.  One problem googling for these
> is that you are going to get piles and piles of random people's <?
> phpinfo() ?> pages.  You'll probably want to add "-phpinfo" and some
> other negative keywords to your google query to restrict the search.
mod_log_bytes is actually apache copyrighted IIRC, but I remember when I
was admin'ing a server with cPanel on and tried to find more info out on
the module, I drew up a huge blank :(

If anyone knows the history of this little known module I'd love to here
about it :P

> But, if you're using 2.x then I think the chances of finding a module to
> do this go way down, and so you'll be back to the method of keeping
> transfer logs and a periodic cron job to do the summing.
I believe mod_accounting works ok on 2.x which is a bonus :P

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/
http://jez.hancock-family.com/  - personal weblog
http://ipfwstats.sf.net/        - ipfw peruser traffic logging

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] bandwidth control - Part 2

Posted by Brian Dessent <br...@dessent.net>.
Jason D wrote:

>     I posted a question about a week ago asking if anyone knows about
> throttling bandwidth per month per VHOST to no avail. I see stats saying
> that apache is running 60% of the web servers out there. But I can not find
> any information on the ability to limit the amount of bandwidth used per
> site per month. Seeing as how 99% of web hosting companies charge this way
> and 60% of the web is run on apache, does this mean that none of the apache
> sites are limiting bandwidth usage in this manor? That is somewhat of a
> rhetorical question / rant due to frustration of not being able to educate
> myself on how to limit bandwidth with apache 2.x. But really what is being
> used to enforce the limits put into place at the point of sale with
> commercial web hosting sites running apache? I know that out of that 60%
> Does anyone on this list use apache to host sites with bandwidth
> limitations?

CPanel and Plesk do this, and they are the most popular webhosting
front-ends.  I think CPanel essentially creates a 'transfer' log for
each vhost, which logs simply the time and # of bytes for each request. 
I think at some frequency there's some process that sums these logs and
handles the accounting.  When a vhost goes over its limit, further
requests generate a 500 error code with a short "Over bandwidth" error. 
It also uses some Apache modules.  If you look at the server signiture
of a host that's running CPanel, you'll see something like:

Server: Apache/1.3.29 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2
mod_bwlimited/1.4 PHP/4.3.4 FrontPage/5.0.2.2634 mod_ssl/2.8.16
OpenSSL/0.9.6b

You should google for mod_bwlimited and mod_log_bytes, but I believe one
or both of them are CPanel-proprietary.  One problem googling for these
is that you are going to get piles and piles of random people's <?
phpinfo() ?> pages.  You'll probably want to add "-phpinfo" and some
other negative keywords to your google query to restrict the search.

But, if you're using 2.x then I think the chances of finding a module to
do this go way down, and so you'll be back to the method of keeping
transfer logs and a periodic cron job to do the summing.

Brian

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] bandwidth control - Part 2

Posted by Brian Dessent <br...@dessent.net>.
Jason D wrote:
> 
> Thanks for the tip I was unaware that anyone could tell if a blanked the
> content of the email. Sorry.

FYI, most email programs insert either a "References:" or "In-Reply-To:"
header that refers to the Message-Id of the post it's a reply to, so
that email programs can display emails in a threaded view instead of a
normal flat listing.  If you use the reply button it will insert those
headers, even if you change the subject and remove all quoting.  It's
actually really handy, and I wish more email programs would do it
correctly.  :-)  Anyway, back on topic now...

Brian

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] bandwidth control - Part 2

Posted by Jason D <ja...@codepanzyz.com>.
Thanks for the tip I was unaware that anyone could tell if a blanked the
content of the email. Sorry.


----- Original Message ----- 
From: "Jez Hancock" <je...@munk.nu>
To: "Jason D" <ja...@codepanzyz.com>
Cc: <us...@httpd.apache.org>
Sent: Sunday, January 11, 2004 1:03 AM
Subject: Re: [users@httpd] bandwidth control - Part 2


> Hi Jason,
>
> Just a tip - don't reply to someone else's post when you're starting a
> new thread - this could well be why you didn't get any response to your
> original posts!
>
> On Sun, Jan 11, 2004 at 12:43:32AM -0800, Jason D wrote:
> > Hello everyone,
> >     I posted a question about a week ago asking if anyone knows about
> > throttling bandwidth per month per VHOST to no avail. I see stats saying
> > that apache is running 60% of the web servers out there. But I can not
find
> > any information on the ability to limit the amount of bandwidth used per
> > site per month. Seeing as how 99% of web hosting companies charge this
way
> > and 60% of the web is run on apache, does this mean that none of the
apache
> > sites are limiting bandwidth usage in this manor? That is somewhat of a
> > rhetorical question / rant due to frustration of not being able to
educate
> > myself on how to limit bandwidth with apache 2.x. But really what is
being
> > used to enforce the limits put into place at the point of sale with
> > commercial web hosting sites running apache? I know that out of that 60%
>
> > Does anyone on this list use apache to host sites with bandwidth
> > limitations?
>
> Have you tried mod_accounting for a start?  The mod_accounting module
> allows you to log the bandwidth consumed on a per vhost basis to a
> database.  You can then query that database on a regular basis via a
> custom script and apply caps to users who are consuming too much
> bandwidth.
>
> mod_accounting is at:
>
> http://sourceforge.net/projects/mod-acct/
>
> There are also other modules such as mod_bwshare and mod_throttle that
> do the job of controlling bandwidth - although these modules only limit
> bandwidth on a short term basis and aren't really suited to keeping
> track of bandwidth consumption over a monthly period.
>
> Googling will find you the sites for mod_bwshare and mod_throttle.
>
> HTH.
>
> -- 
> Jez Hancock
>  - System Administrator / PHP Developer
>
> http://munk.nu/
> http://jez.hancock-family.com/  - personal weblog
> http://ipfwstats.sf.net/        - ipfw peruser traffic logging
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] bandwidth control - Part 2

Posted by nico <tr...@hotmail.com>.
Ok will check to write a script to do that.

In php ... maybe with a cron.

Thanks




> There is, all you need is the logs which Apache 2 will happily write for
> you. It shouldn't take more than 20 minutes to write a custom script that
> extracts the transfered amount in a given time period. You could also
write
> your own module!
>
> Most hosting services (including myself) do not usually cap when a host
> reach it transfer limit, but instead calculate it at the end of the month
> and charge for it. I would only cap a host if it has so much traffic it
> hurts other hosts.
>
> > The apache fundation say us to migrate to apache2 but if it's so hard
> > to find a module for this version nobody will upgrade his version !!!!
>
> Sadly, the porting of modules to Apache 2.0 is slow. One reason is that
too
> few admins are willing to take the lead in using it, and thus there is
less
> demand for porting the old 1.3 modules.
>
> Regards,
> Robert Andersson
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] bandwidth control - Part 2

Posted by Robert Andersson <ro...@profundis.nu>.
nico wrote:
> So there is no way to monitor bandwitch with apache 2 ?

There is, all you need is the logs which Apache 2 will happily write for
you. It shouldn't take more than 20 minutes to write a custom script that
extracts the transfered amount in a given time period. You could also write
your own module!

Most hosting services (including myself) do not usually cap when a host
reach it transfer limit, but instead calculate it at the end of the month
and charge for it. I would only cap a host if it has so much traffic it
hurts other hosts.

> The apache fundation say us to migrate to apache2 but if it's so hard
> to find a module for this version nobody will upgrade his version !!!!

Sadly, the porting of modules to Apache 2.0 is slow. One reason is that too
few admins are willing to take the lead in using it, and thus there is less
demand for porting the old 1.3 modules.

Regards,
Robert Andersson


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] bandwidth control - Part 2

Posted by nico <tr...@hotmail.com>.
So there is no way to monitor bandwitch with apache 2 ?

The apache fundation say us to migrate to apache2 but if it's so hard to
find a module for this version nobody will upgrade his version !!!!


> On Sun, Jan 11, 2004 at 01:46:55AM -0800, Jason D wrote:
> > Yeah I have looked at both mod_bwshare and mod_throttle, neither are
> > suitable for my needs on a RH9 Apache 2.x platfom. I took a look at the
link
> > for mod_accounting, http://sourceforge.net/projects/mod-acct/ , and see
that
> > while it will work on RH it is only for apache 1.3 per
> > http://mod-acct.sourceforge.net/ . So I guess that is that.
> Ah, sorry I thought mod_accounting had been ported to 2.x - my bad :(
>
> --
> Jez Hancock
>  - System Administrator / PHP Developer
>
> http://munk.nu/
> http://jez.hancock-family.com/  - personal weblog
> http://ipfwstats.sf.net/        - ipfw peruser traffic logging
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] bandwidth control - Part 2

Posted by Jez Hancock <je...@munk.nu>.
On Sun, Jan 11, 2004 at 01:46:55AM -0800, Jason D wrote:
> Yeah I have looked at both mod_bwshare and mod_throttle, neither are
> suitable for my needs on a RH9 Apache 2.x platfom. I took a look at the link
> for mod_accounting, http://sourceforge.net/projects/mod-acct/ , and see that
> while it will work on RH it is only for apache 1.3 per
> http://mod-acct.sourceforge.net/ . So I guess that is that.
Ah, sorry I thought mod_accounting had been ported to 2.x - my bad :(

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/
http://jez.hancock-family.com/  - personal weblog
http://ipfwstats.sf.net/        - ipfw peruser traffic logging

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] bandwidth control - Part 2

Posted by Jez Hancock <je...@munk.nu>.
Hi Jason,

Just a tip - don't reply to someone else's post when you're starting a
new thread - this could well be why you didn't get any response to your
original posts!

On Sun, Jan 11, 2004 at 12:43:32AM -0800, Jason D wrote:
> Hello everyone,
>     I posted a question about a week ago asking if anyone knows about
> throttling bandwidth per month per VHOST to no avail. I see stats saying
> that apache is running 60% of the web servers out there. But I can not find
> any information on the ability to limit the amount of bandwidth used per
> site per month. Seeing as how 99% of web hosting companies charge this way
> and 60% of the web is run on apache, does this mean that none of the apache
> sites are limiting bandwidth usage in this manor? That is somewhat of a
> rhetorical question / rant due to frustration of not being able to educate
> myself on how to limit bandwidth with apache 2.x. But really what is being
> used to enforce the limits put into place at the point of sale with
> commercial web hosting sites running apache? I know that out of that 60%

> Does anyone on this list use apache to host sites with bandwidth
> limitations?

Have you tried mod_accounting for a start?  The mod_accounting module
allows you to log the bandwidth consumed on a per vhost basis to a
database.  You can then query that database on a regular basis via a
custom script and apply caps to users who are consuming too much
bandwidth.

mod_accounting is at:

http://sourceforge.net/projects/mod-acct/

There are also other modules such as mod_bwshare and mod_throttle that
do the job of controlling bandwidth - although these modules only limit
bandwidth on a short term basis and aren't really suited to keeping
track of bandwidth consumption over a monthly period.

Googling will find you the sites for mod_bwshare and mod_throttle.

HTH.

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/
http://jez.hancock-family.com/  - personal weblog
http://ipfwstats.sf.net/        - ipfw peruser traffic logging

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


AW: [users@httpd] bandwidth control - Part 2

Posted by SH Solutions <in...@sh-solutions.de>.
Hi

> Seeing as how 99% of web hosting companies charge this way and 60% of the
web is run on apache, does this mean that none of the apache sites are
limiting bandwidth usage in this manor?

Yes, i think - mostly.
Most of these ISPs do something even better. They simply count how much
traffic there was - which is easy looking at the access logs. And if there
is more traffic than allowed per month, they send some extra bills. This is
a more commercial way of limiting traffic - thou they do not have to (and
even do NOT want to) stop traffic at any limit, it's just where they make
good money. :D

cu,
  Steffen


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org