limit bandwidth


How can I limit server bandwidth (100mbs) without using QoS of router?
Do you know some softwares or can virtualmin/webmin do it?

Well, what’s your goal – what problem are you attempting to solve?

Are you trying to limit total bandwidth during any given month?

Are you trying to limit the size of your pipe – perhaps to slow down "leeching" from spiders or similar?

The specific problem you’re trying to solve would effect how you might go about this – as well as how easy it’d be to implement :wink:

No, I’d like to limit the connection of some servers, not using QoS of cisco router but only with a software. Is it possible?

It sounds like you’re saying you’d like to limit the available “pipe” to certain Virtual Servers (domains) – not the total monthly bandwidth, but how much bandwidth can be used at any one time.

I’m aware of three modules that were made as an attempt to solve that problem (none of which are directly supported by Virtualmin and all of which will require manual compilation and installation :wink: – mod_throttle, mod_cband, and mod_bw.

The first, mod_throttle, is now defunct and no longer available.

I don’t have any experience with the other two, but there’s plenty of documentation out there on how to get them up and running. From what I can tell, neither have had releases since 2005/2006, but both appear to work in Apache 2.

It will be good if virtualmin supports them :slight_smile:

Well, that functionality would indeed be cool.

That’s a tough proposition though – since none of those modules are actually being developed anymore, it’s tough for something like Virtualmin to support them.

As soon as folks got used to it being there, a new version of Apache could come out, breaking compatibility with those modules. And people don’t like it when things that once work suddenly stop :slight_smile:

As Eric mentioned, we simply can’t support abandoned, non-core, Apache modules.

We’re contemplating (with much trepidation) adding support for mod_gnutls, in order to get multi-domain certificate support. But it’s been in active development for several years, has a lot of users, and is not abandoned. And, also, seems like a likely candidate for official inclusion in Apache at some point in the future.

But, even thinking about supporting that one makes it a little harder for me to sleep at night (knowing that if it is abandoned in the future, I’m screwed and will have to figure out a way for us to fund continuing maintenance on it).

and if I want to limit all server’s bandwidth (for apache, ftp sever, email server…)? Is it possible?

Thank you very much

It’s possible, but it’s not necessarily simple :slight_smile:

You may want to look into traffic shaping and rate limiting.

First, I know you were looking to avoid this, but it’s going to be much more straight forward if your ISP does this for you on their end, the routers they have setup probably make this all fairly easy to do.

That said, if you want to explore doing it on your box, examples such as these might help you get started:

Also, Shorewall is a tool that makes setting up firewalls and traffic shaping a bit simpler, you might find it more straight forward than using the above directly:

I haven’t done much at all with any of this, I’m just pointing out some resources if you’re really eager to be able to do this from your own box :slight_smile:

Have a good one,

you don’t advice me to install shorewall on a real server?

You asked if limiting bandwidth on ones server is possible – all of the above options are viable solutions to that problem – including Shorewall.

My "advice" is to get your ISP to perform your bandwidth limiting :slight_smile:

Everything else I’m mentioning are purely thoughts and ideas that might help you accomplish what you’re asking.

However, having a router outside of your own box performing the rate limiting is the best and simplest solution.

Inside virtualmin admin panel there is the option for Bandwidth Monitoring under the System Settings.
Inside it mentions bandwidth limits for individual servers.
Can somebody tell me how this works and where these limits can be defined ?
Is this related to this discussion ?

Many thanks and best regards to all.

…hmmm…some additional questions please if I may:

Since /etc/webmin/virtual-server/ is running (I guess this is the bandwidth tool (?) ), I get every couple of minutes a change in all the signature of the domain files:
Integrity checksum changed for: ‘/etc/webmin/virtual-server/domains/122207224026825’

Is it normal ?

Thanks again so much

all you see in Bandwidth Usage is to be consider traffic usage.

Yeah, the bandwidth monitoring measures how much web, email, and ftp traffic has been utilized in a given time period (typically a month).

If a customer goes over their limit, you can set it up to disable their Virtual Server if you like.

And yeah, collects the bandwidth usage stats seen in the Bandwidth Monitoring section. I’m guessing the changes you’re seeing in those files is due to that – it has to save all that information each time it runs.

May I ask how (where in the virtulmin interface) can I set these bandwidth limits per server ?
I cannot find anything like that…

When you log into Virtualmin, choose "Edit Virtual Server", then go into "Quotas and limits".

You’ll see “Bandwidth limit” listed there.

Generally on Cpanel’s servers I see this
Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7a mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/ PHP/5.2.6 Server at Port 80

What’s mod_bwlimited?. It seems to be opensource.

EasyApache Bandwidth Module

The module used for limiting bandwidth usage differs depending on the branch of apache you are using. The modules that are used are:

* Apache 1.3.x - mod_bandwidth - from
* Apache 2.x - mod_bw - from

Both Apache branches use /scripts/setbwlimit to modify the bandwidth limits for specific virtualhosts. See /scripts/setbwlimit --help (after you compile Apache with the module) for more information.

It’s mod_bw, but the Release Date is 17-03-2007

Apache2 - Mod_bw v0.8

Author : Ivan Barrera A. (Bruce)

HomePage : Http://

Release Date : 17-03-2007

Status : Stable

License : Licensed under the Apache Software License v2.0
It must be included as LICENSE in this package.

Platform : Linux/x86 (Tested with Fedora Core 4, Suse, etc)
Linux/x86_64 (Redhat Enterprise 4)
FreeBSD/x86 (Tested on 5.2)
MacOS X/Ppc x86 (Tested on both platforms)
Solaris 8/sparc (Some notes on compile)
Microsoft Windows (Win XP, Win2003. Others should work)
HP-UX 11 (Thanks to Soumendu Bhattacharya for testing)

Notes : This is a stable version of mod_bw. It works fine with
almost any MPM (tested with WinNT/prefork/Worker MPM).

Limitations : This mod doesn’t know how fast is the client really
downloading a file, so it just divides the bw assigned
between the users.
MaxConnections works only for the given scope. (i.e , all
will limit maxconnections from all,not per ip or user)

It’s not a close project.