Bandwidth carry over

Twintone

Verified User
Joined
Jun 3, 2003
Messages
42
I have a question about carrying bandwidth not used to the next month. I am starting to see a bunch of hosts now offering "pay for what you use" and I was wondering if it could be build into DA as an option to carry over unused bandwidth to the next month.

So, say someone signs up for an account where you only pay for what you use, and that amount is 10GB.. and they only use say 6GB that month, they would still have 4GB left on the account.. and it would carry over to the next, and once they started to get low, and wanted to buy more, I could just add the amount onto their account.

This would also have to include the option of, if they were to use up all of their bandwidth, it would suspend the account at that time.

Would this be very difficult to implement? I would like to start offering this type of hosting, and keep up with other hosts that are able to offer this..

Thanks much
 
It wouldn't be that bad, there would be some manual work involved. Say a customer had 4GB of bandwith left, and they wanted to add 10GB, you would have to basically manually go into their account and add 10GB, for a total of 14GB.. if that makes sense.. it wouldn't be all that bad, unless you have 1000's of accounts. Its just something I wouldn't mind seeing to "keep up with the Jones' " ;)
 
Hello,

*Actually* :) ... all you need to do is remove/change the "monthly reset" cron job.

/etc/cron.d/directadmin_cron

20 0 1 * * root echo 'action=reset&value=all' >> /usr/local/directadmin/data/task.queue

You can either remove the line completely, or change it to whatever you need. If it never "resets", the bandwidth will just keep adding up until they reach the limit. Upon receiving payment, you can reset just that user by running:

echo 'action=reset&value=username&type=user' >> /usr/local/directadmin/data/task.queue

(as root) to reset that User's bandwidth back to zero.

John
 
Re: so what would you change to...

ProHS said:
Hi, John

So what would you change to have it carry over the extra bandwith in that file ?

Scott-
www.prohs.com

He just gave the solution ?

Im assuming every 30 days or 1 month DA adds the specified quota to whatever is already there, usually the cron job removes the previos months quotas so the user gets a fresh quota which is what the admin / reseller specifies. If the cron-job is removed the previous months quota remains there and the next months quota gets added on top.

30GB per month quota
Month 1 - used 20GB

Month 2 - my bandwidth quota will be 60 (2 months on top of each other) and my previous used data remains there.

Month 2:
available: 60GB
used at start: 20

therefore you have 10 'rollover' GB's from the previos month and the current 30MB for the month.

If im wrong in thinking thats how it works please correct me - im guessing here :D

Chris
 
Hello,

Your probably right but what i was wondering if that would work if you have 3 packages or more, in less you just add 3 lines and so on ? But yes he did give the solution but i was just wondering more information about it.

Scott-
Pro Hosting Solutions
 
Hello,

This is an all or nothing solution.. not settable by package. If you use it, *all* accounts on the server will abide by the no time limit rule.

If you want to never have bandwidth reset, ie users can always just use up all their bandwidth until their done, just completely remove the line from the file.

or you can change how often the bandwidth resets by changing the cron values (man -S5 crontab)

John
 
roll over from month to month only

How can this be done?

If your package allows 40 GB of bandwidth per month and in July you only use 15 GB of bandwidth, the unused amount (25 GB) will roll over to the next month (August). Now for August you would have a total of 65 GB you can use for August (the original 40 GB + 25 GB unused from the previous month). Unused bandwidth can only be rolled over from one month to the next, and can only be used for the next month (unused bandwidth from July can only be used in August, it can not be rolled over to September).

If it reguires some programming would someone be willing to do this for a price?
 
Hello

I think the only "simple" way of hacking that in would be to add the leftovers to the new months bandwidth limit. So if you have 25 gig left over, so the script would have to set the upper limit to be 65 gig... you'd just set it in the /usr/local/directadmin/data/users/resellername/reseller.conf under the "bandwidth=" setting.

John
 
DirectAdmin Support said:
Hello

I think the only "simple" way of hacking that in would be to add the leftovers to the new months bandwidth limit. So if you have 25 gig left over, so the script would have to set the upper limit to be 65 gig... you'd just set it in the /usr/local/directadmin/data/users/resellername/reseller.conf under the "bandwidth=" setting.

John



OK but the bandwidth can only be rolled over for one month.

Example:
Your package allows 40 GB/month. In July you only use 15 GB so in August your unused 25 GB from July is rolled over, you now have a total of 65 GB you can use for August. Now lets say for August you only used 18 GB, you would then rollover the unused 22 GB (your package allows 40 GB - 18 GB used = 22 GB available for rollover) to September. September bandwidth would be 62 GB (40 GB + the 22 GB rolled over).

Is this doable?
 
FreeBSDGuy said:
OK but the bandwidth can only be rolled over for one month.

Example:
Your package allows 40 GB/month. In July you only use 15 GB so in August your unused 25 GB from July is rolled over, you now have a total of 65 GB you can use for August. Now lets say for August you only used 18 GB, you would then rollover the unused 22 GB (your package allows 40 GB - 18 GB used = 22 GB available for rollover) to September. September bandwidth would be 62 GB (40 GB + the 22 GB rolled over).

Is this doable?


Can the above be done?
 
Hello,

Sounds a bit tricky with the "1 month only" bit. I'm sure it could be done if you're willing to figure out the scripting. You'd probaly need to add lists of how much was left over, then remove that from the total at the end of the 2nd month (or something like that)..

John
 
Bandwidth usage last month

Hey guys, and girls ofcourse,

I got a question that relay's to this subject I think.

Wouldn't it be easyer for the DirectAdmin creators aswell for the users to give the opportunity to save the usage's of the previous months.

In this way, the users can calculate the used bandwith (and diskspace) themselves, and I think it isn't that hard to implement into the system.

We also use "pay with you use ", but we must save the usage at the end of every month. And it would be nice if we just don't have to do that, but we can simply click on "Usage history" or something like that.

Greets,

Frank
 
Back
Top