Using rate limit function for a client

akymakr

Verified User
Joined
Oct 15, 2011
Messages
20
Location
Hong Kong
I have a client who have built a file upload system for public use.
This is not a good idea but I want to tell the client "Hey, my server doesn't allow you to use this type of system".
Instead I want to limit the network bandwidth (KB/s) to only the file upload system without telling the client.

I have found some tutorials and one of them is rate_limit module.
This is lucky that I already have this in my Apache.
If you manually modify the client's file, the client may notice ...

Either he will report someone might just hacked into his account or he knows what the trick is and manually delete it.
I need to find a better way that he cannot modify by himself and I don't need to notify him.
Maybe the custom httpd.conf in DirectAdmin can do the job but I am unfamiliar with this.
Also I have a nginx proxy in DirectAdmin.

So how to make the trick working? (Where should I put into?)
SetOutputFilter RATE_LIMIT
SetEnv rate-limit 400
btw, 400 equals to 400KB/s

Thanks for helping me saving network bandwidth and I don't need to notify him in advanced.
 
Hi Akymakr,

You can put this into the httpd.conf from the user you want to limit:
/usr/local/directadmin/data/users/USERNAME/httpd.conf

A better way to do this to make it update proof:
https://help.directadmin.com/item.php?id=3

But to be honest I think it would be better to take a look at your services conditions. In case you don't want to allow a system like this you should note this down so you can inform the user if he still does it.

Regards,
Niels
 
Last edited:
I think that you may need mod_cband for apache, anyway, you should put this in the custom apache configuration for the specific domain:
YOUR-DA-HOST:2222/CMD_CUSTOM_HTTPD?domain=DOMAIN

Probably in "CUSTOM2" section, but i'm not sure, you may need to google a bit to understand where this have to be set, and test on a test domain before change the user's apache configuration ;)

Regards
 
Thanks vlijmenlive and SeLLeRoNe!

I just noticed rate limit is not enough to limit the network bandwidth. mod_cband actually doing well and it can throttle the speed in loading web pages.
So I am now using only mod_cband to limit the network bandwidth.

It did well in loading webpages but not in downloading ... it's still downloading in full speed. (I have nginx proxy for my server)
What do I need to do in order to limit the download speed as well?
Thanks!
 
Back
Top