Portal Home > Knowledgebase > Articles Database > Limit CentOS bandwidth


Limit CentOS bandwidth




Posted by ryan14, 09-12-2009, 06:03 AM
If i have CentOS and Lighttpd, how can i set a bandwidth limit of 4TB per month, and once the limit is reached the server will automatically shut down?

Posted by nomankhn, 09-12-2009, 12:05 PM
What i understand is that, lets suppose your eth0 is use for that purpose, you need to save its traffic in mysql and save in database and write a php script that will check if 4tb usage complete then shutdown the server, also put a check on monthly basis as well.

Posted by Adam-AEC, 09-12-2009, 07:29 PM
Install vnstat. Write a daily crontab that parses the vnstat output and checks how close it is to your 4TB. If close/over, shutdown server. Write monthly crontab to ensure vnstat resets at beginning of tracking period.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
httpd.conf for a forum (Views: 467)
Hostestate Reviews? (Views: 475)