Re: Possibl to give reseller a big chunk of CPU/RAM/DISK IO? (Like disk &
Hi Igor,
It is a very good dilemna.
First, let me admit that I am not very smart. I am just trying to put some ideas out into the wild so that smarter people then me can take that idea and make it correct, or throw it into the garbage if it's not any good.
In my mind, I see this problem is very much like how disk space allocation works now for resellers in WHM. Let's say that a WHM reseller is given a 10gb of disk space allowance, and he creates 10 accounts that each are allowed a maximum of 2gb. This is overselling, of course, and is the most common scenario for 99% of hosting companies. The way it works now, is that each cpanel account can use up to the 2gb maximum the reseller gave them...even though the reseller might be above his total reseller account limit.... so this reseller might have a total of 20gb disk usage even though he is only given a 10gb disk space limit.
The problem is that there is no practical way to limit the individual cpanel accounts, for the exact same reasons you have mentioned in your previous reply. How can we say that the account is not allowed to use all 2gb it is alloted, because their parent reseller is over his reseller account limit? That's not good business.
As a "fix", I have created a script that runs each day and determines what is the total amount of disk space usage for each of the reseller's accounts.. and then sends a notification to the reseller if this total has exceeded their total reseller limit. Then the reseller must contact us to discuss an upgrade of their reseller account, or eventually we will contact them to suspend their reseller account for excessive usage.
I think that perhaps the cloudlinux system for resellers might work in the same way.
For example, let's say the reseller is allowed to have 2 CPU cores total usage. Now he creates 10 accounts that each have a 1 core limit. So everything runs normally like it does now, and cloudlinux keeps track of usage, etc. Then, once a day, cloudlinux runs the "reseller stats process" and it looks at the maximum usage for all cpanel accounts owned by the reseller. It calculates that during the last 24 hours, the combined (at any one time) total number of cores was higher then the limit allowed... so it sends an email to the reseller with the details and suggests they contact the hosting provider to consider upgrading. (ie: The email includes the statistics for all the accounts at the time when the combined total was over, so reseller can see which accounts are using more/less, etc.) Of course this information about each reseller's "last 24 hours of usage" should also be available in the WHM plugin area.
I hope that makes sense?
It is not a perfect solution and does not work in "realtime". However, it is basically good enough. It's sufficient so that the server owner can sell reseller accounts with a CPU limit, and be automatically notified when a reseller is using more then their limit.
This sort of system shouldn't be too difficult to add to the current version. It is mostly just "after the fact" statistics processing...
One additional feature that could also be added to the system above, is that each reseller is not only limited by the TOTAL amount of cpu and/or cpu cores ... but also by the total he can assign to any individual cpanel account he creates. So for example, you could specify a TOTAL limit of 4 cpu cores (as I explained above), but then also limit each cpanel account "under" the reseller to a maximum of say 1/2 core. So this way, all reseller's accounts are automatically limited to 1/2 core maximum, no matter what package they have or any other settings. (And of course, admin can over-ride that limit if desired...)
I hope that also makes sense? The nice thing about a limitation system like that is we can then sell reseller accounts based on the maximum amount of CPU for the created cpanel accounts. (ie: Reseller plan A has cpu max of 1 core. Reseller plan B has cpu max of 2 cores. The TOTAL combined cpu usage might be 6 cores.)
What do you think of something like that?