Shaping based on monthly bandwidth limit (comcrap's 250GB quota)?

  • Is there a way to setup a monthly bandwidth quota? For example, comcrap's 250GB limit. Is there a way to limit the wan to 250GB aka auto disabling it when that limit is hit? Even better, would there be a way to set a limit to 250GB and auto limit the WAN less and less as it approches the 250GB limit? Like, at 245GB 90% of the upload traffic is limited in speed? This way incoming traffic still works without being cut off. Such a formula could be expressed in available GB for the rest of the month to how many days are remaining in the month. Something like:

    quota=monthly quota in kB
    x=total amount of bandwidth consumed so far for this month in kB
    86400 seconds in a day
    y=days remaining in the month
    z=upload limit


    250GB = 262,144,000kB

    z=(262,144,000-x) / 86400/y

    So lets say it is a new month so you've downloaded+uploaded 0kB. Also, there is 30 days remaining. The formula would then be: z=(262,144,000-0) / 86400/30
    z=101.135kB/s max upload.

    Another example: It is half way through the month (15 days left) and so far only 5GB up+down have been transfered.
    z=(262,144,000-5,242,880) / 86400/15
    z=198.226 kB/s

    I'm sure someone could make a better formula for this since what I wrote above is extremely conservative. Setting something up like this for bulk aka p2p transfers would be nice. This way normal uploads like email, ack packets, and so on would not be effected.

    Anyone know how to do this? If not, is there a way to request such a feature?

    Note: I said upload traffic limited because on most situations if someone is going to download 100MB they are going to DL 100MB regardless if their speed is dialup or 100megabit/s. However, when uploading for, say p2p, limiting the upload rate will in fact alter the total amount of bandwidth overall helping to stay under the quota.

Log in to reply