I setup service plan in PBA-E to allow customer have 1GB of disk space. Resource is set to be Measurable = No, Controlled by = "External system" in PBA-E which according to documentation means:
"Measurable = No, Controlled By = External System. PBA requests external system to allocate only purchased resource quantity, does not accumulate statistics of the resource use and relies on the external system to not allow resource overuse."
However, in POA I can see that even though limit of disk space resource is set to 1GB (as expected), usage is greater than limit (for example 2GB) and POA shows overusage.
Why does POA allow overusage? Is Controlled By = External System not working correctly?
"Controlled By = External System" works as described in documentation. PBA-E relies on external system (POA in this case) to not allow resource overuse. Problem is that on POA side "Diskspace" resource can be overused as it is not hard limit.
POA subscription can include different services (Apache, Qmail, etc). All these services can contribute to usage of disk space resource. For most of these services POA allows to hard limit disk space but it is not controlled by limit of "Diskspace" resource included in subscription: For Apache - it is controlled by activation parameters "Web disk space usage soft limit, (KB)" and "Web disk space usage hard limit, (KB)" (in 5.5 these activation parameters are moved to resource limits with same names). For Qmail - it is hard limited by activation parameter "Maximum quota for a mailbox in Kb" and amount of mailboxes included in subscription. for MySQL - POA has no means to hard limit database size as MySQL itself has no native mechanism to do this in shared hosting environment. Feature request to implement this functionality exists - POA-59511.
To find which exact services contribute to disk space usage in subscription, the following query can be used in POA DB:
SELECT * from disk_space_paths WHERE path_id IN (SELECT path_id from disk_space_elems where rti_id = (SELECT rt_instance_id from subs_resources where sub_id = SUBSCRIPTION_ID AND rt_id = DISKSPACE_RESOURCE_TYPE_ID))
To limit disk space that can be occupied by Apache webspace:
If web server is a Virtuozzo VPS, make sure second level quotas are enabled (http://download.swsoft.com/virtuozzo/virtuozzo4.0/docs/en/lin/VzLinuxUG/293.htm) NOTE: do not change limit of quotaugidlimit directly from Virtuozzo side as POA will ovewrite it. Limit should be changed from POA > VPS > Resources tab > Edit
- Adjust activation parameter "Web disk space usage soft limit, (KB)" and "Web disk space usage hard limit, (KB)" in service template according to your needs. In POA 5.5 these activation parameters were converted to resource limit and thus should be managed using resource rates in PBA-E or (if no resource rate defined) by adjusting limits in service template in POA.
To limit disk space that Qmail mailboxes can occupy:
- Decide what maximum amount of mailboxes you want to allow in subscription and how much disk space you want to allow for Qmail overall.
- Set activation parameter "Maximum quota for a mailbox in Kb" accordingly.