# set bandwidth usage



## fred974 (Jun 9, 2016)

Hello,

I have a web server that run on FreeBSD 10.2 and sysutils/iocage.
Every domain has its own jail..
To serve all the domain jails, I have a web reverse proxy jail.
My question is: 
How can I set the monthly bandwidth usage of let say 4GB/month when we haven't got a cpanel installed?

What tools do you guys use?

Thank you


----------



## ab2k (Jun 11, 2016)

Hi, think you have to parse the logs of reverse proxy and make daily statistics of bandwidth used for every jail configured. According to this data you may turn off jails or set virtual interface to 1kbit/s or smth like that... Never played with sysutils/iocage actually, but know that it have many configurable limits - check it out, probably you will find something according to network limits.


----------



## Abriel (Jun 11, 2016)

Hi,

You can try net-mgmt/pmacct with *mysql*. It will count transfer. Make simple script with  /sbin/ipfw add pipe.


----------



## fred974 (Jun 11, 2016)

Thank you for your input.
I use PF.. I undertstand how to create a script to query the DB daily but if the limit is reached, How can I dynamicly tell pf or sysutils/iocage to throttle the IP/jail?
fred


----------

