Below you will find the description of the billing logic and how the billing is calculated for the following billing plan resources:
- Hourly and monthly resource limit types
- Calculation for the missing period
- IP addresses
If you remove from the billing plan a resource that has virtual server(s) running on it, the pricing for that resource will be removed for such VSs. This behavior refers to user VS limits, template stores, edge groups, recipe groups, backup server zones and guaranteed minIOPS.
Hourly and monthly resource limit types
It is possible to choose hourly or monthly billing when adding a data store or network zone resources to the OnApp billing plan.
When setting hourly resource type, the limits for resources are set per hour, and the statistics is gathered hourly and then is compared to the free resource limit. Then, the resource limits which exceed the free amount allowed are billed.
When setting monthly resource type, the limits for resources are set per month, and the statistics is gathered hourly and then is compared to the free resource limit set per month. When the free limit set per month is exceeded, the exceeding amount is billed based on the overusage price per resource per hour.
For example, user adds a data store zone monthly resource to the billing plan and sets free data read limit per month to 50 GB:
During the first hour, 50 GB are used (all the free limit).
During the second hour, 2 GB are used. As there’s no free limit left, the user is charged for 2 GB per hour.
- During the third hour, 5 GB are used. Since there’s no free limit left, the user is charged for 5 GB per hour (previous 2 GB over limit are not taken into account, since they are already billed).
If a user adds a data store zone hourly resource to the billing plan and sets free data read limit per hour to 50 GB:
During the first hour, 5 GB are used. As the free limit is 50GB the user is not charged (all the free limit).
During the second hour, 52 GB are used. The user is charged for 2 GB over free limit per hour.
- During the third hour, 55 GB are used. The user is charged for 5 GB per hour overusage (previous 2 GB over limit are not taken into account, since they are already billed).
When a data store or a network zone is added to the master template, its limit type (hourly or monthly) is overridden by the master template. If a zone is removed from the master template, it's limit type will become the same as it was before the master template was applied to the zone.
Calculation for the missing period
Under certain circumstances, statistics might be missing for a period of time. This might happen due to daemon issues, cron jobs failures, or some other unexpected errors with the statistics collection mechanism. In such cases the instant (raw) statistics is aggregated for the whole missing period, and the calculated amount is added into the hourly statistics for the first hour when the services are up again. This behaviour is relevant only to the resources which are calculated dynamically on hourly basis, in particular:
Data store zones
The following scheme demonstrates this bahavior for Data Received for network zones as an example:
In this example:
The last value for data received (Hour1) reported as hourly statistics for the network zone in question was 10GB. Then the OnApp daemon stopped working, and no hourly statistics were generated for Hour2, Hour3, Hour4, and Hour5. On Hour6 the problem was fixed, and daemon was up again. The hourly statistics for Hour6 will aggregate all the statistics for the whole missing period into that hour. Most probably you will get a huge value for the Hour6 as it will be the summary for the whole period when no stats have been reported. Pay attention that the Outstanding amount and Total amount for users will be calculated as per one hour: the whole aggregated statistics will be regarded as statistics per one hour, and compared to the free limits and charged for overusage.
As a workaround, to fix the overcharging for the aggregated stats, you can use the payments functionality. Add the appropriate value as a payment for a user, and it will be subtracted from the Total amount.
Each virtual server has two IP types: regular and outside. Public IP addresses are used for servers’ Internet access. Private IP addresses are used for private networks.
When calculating IP address billing for a particular resource, each virtual server’s IP address is compared to the free IP limit in a linear queue (starting with the first added IP address). Regular IPs are calculated first.
The IP address billing calculation:
Free IP address limit is 3.
The first virtual server has two regular and two outside IP addresses, but the second regular IP address is the same as the second outside IP address, so the number of unique IPs assigned to this virtual server is 3.
The second virtual server has two regular and two outside IP addresses.
According to the billing algorithm, the first regular IP address checks if there are some IPs added before it and then gets compared to the free IP address limit. 1 < 3, so it is not charged (2 IPs of free disk size limit left).
Then, the second IP address is compared to the remaining free IP address number. 1 < 2, so the second IP also is not charged (1 IP of free disk size limit left).
After that, the outside IPs are calculated:
The first outside IP address checks if there are some outside IPs added before it and then gets compared to the free IP address limit.
1 ≥1, so this IP address is not charged (0 IP of free disk size limit left).
Then, the second outside IP is compared to the remaining free IP address number. There are no free IPs left, but since the second regular IP address equals the second outside IP address, the second IP also is not billed.
Consequently, all IP addresses of the second virtual server are billed, as the free IP address limit is already used up.
Port speed is calculated by subtracting the free port speed value from free port speed limit and summing up the remainders. If the disk’s port speed is less that the free port speed limit, it is not billed.
If the NIC port speed is set as Unlimited in the billing plan, it means that the maximum port speed value is the value specified in the Control Panel Settings menu > Configuration > Max network interface port speed field.
The port speed billing calculation is the following:
In this example, free port speed limit is 20 MB/second.
First virtual server has two NICs.
NIC 1 = 10 MB/second
NIC 2 = 25 MB/second
Second virtual server has two NICs.
NIC 3 = 10 MB/second
NIC 4 = 30 MB/second
Then, (10 - 20) + (25 - 20) + (10 - 20) + (30 - 20) = 15 MB will be charged.
Since the first and the third NICs are less than the free amount, they are not charged.
Guaranteed minIOPS is calculated by subtracting the free IOPS value from each disk’s IOPS and summing up the remainders. If the disk’s IOPS is less that the free IOPS value, it is not billed.
With this in mind, the formula for minIOPS billing calculation is:
In this example, free IOPS = 45
Disk 1 has 50 IOPS
Disk 2 has 45 IOPS
Disk 2 has 60 IOPS
Disk 4 has 20 IOPS
Then: (50-45) + (45-45) + (60-45) + (20-45) = 20 IOPS which is billed.
Since the second and the fourth disks’ IOPS values are less than the free amount, these disks are not billed.
When calculating disk size billing for a particular resource, each virtual server’s disk size is compared to the free disk size limit in a linear queue (starting with the first added disk), then each next disk is compared to the free disk size limit remainders.
The disk size billing calculation is:
Free disk size is 50 GB.
We have two virtual servers assigned to the same data store.
The first virtual server has two disks.
Disk 1 = 15 GB
Disk 2 = 20 GB
The second virtual server has two disks.
Disk 1 = 20 GB
Disk 2 = 15 GB
According to the billing algorithm, the first disk checks if there are disks added before it and then gets compared to the free disk size limit:
15< 50, so it is not charged (35 GB of free disk size limit left).
Then, the second disk is compared to the remaining free disk size limit:
20 < 35 (15 GB of free disk size limit left).
So, the second disk is also not charged.
After that, the second virtual server’s disks are processed. The third disk is compared to the remaining free disk size limit:
20 >15 (20 - 15 = 5, so 5 GB of the disk’s size will be charged).
Finally, the fourth disk is charged for the whole disk size, as the free disk size limit is already reached.
CPU, CPU shares and memory limits are set for the Compute zone.
When calculating CPU billing for a particular resource, the sum of all virtual server’s CPU over the free limit is billed.
So, the CPU billing formula can be displayed as follows:
Free CPU limit is 3.
If we have two virtual servers:
The first VS has 2 CPUs
The second VS has 3 CPUs
The number of CPUs charged: (2+3) - 3 = 2
To calculate the CPU shares price for the virtual server, multiply the number of server’s cores by CPU priority percentage given.
Then, each virtual server’s CPU priority value is compared to the free CPU shares limit in a linear queue (starting with the first added virtual server), then each next virtual server is compared to the free CPU shares limit remainders.
In this example, free CPU shares limit is 140.
The first virtual server has 2 CPUs and 50% CPU priority (100% in total).
The second virtual server has 3 CPUs and 40% CPU priority (120% in total).
According to the billing algorithm, the first virtual server checks if there are servers added before it and then gets compared to the free CPU shares limit:
100 < 140, so it is not charged (40 of free CPU shares limit left).
Then, the second virtual server is compared to the remaining CPU shares limit:
120 > 40 (120 – 40 = 80), so 80 percent of this server’s CPU shares will be charged.
The amount of CPU resource a VS is given, is the CPU priority (you can think of this as its "share percentage") multiplied by the number of cores allocated to that VS. This is a minimum number – clients can burst over it, up to 100% multiplied by the number of cores. For example, on a Compute resource with 3GHz CPU cores:
- 100% x 1 core = 3GHz (burstable to 3GHz)
- 10% x 2 cores = 600MHZ (burstable to 6GHz)
- 5 % x 4 cores = 600MHz (burstable to 12GHz)
By default, OnApp allows overselling of cloud resources. For example, OnApp will allow users to create 5 VSs with 100% CPU priority/1 CPU core on a Compute resource with a 4-core CPU. In this example, OnApp would reduce the guaranteed CPU for each VS.
If you build a VS on a KVM Compute resource, the CPU priority settings will be disabled and CPU priority value will be 100 by default.
The CPU unit is an abstract figure that replaces CPU priority. It is an arbitrary relative value that the host can enter to mark the capacity of the Compute resources in a zone. It is the host's responsibility to enter the values per Compute resources correctly and logically. You can set the amount of units per Compute zone and per each particular Compute resource in a zone. If you set the CPU Units per Compute zone, then each Compute resource in this zone will be assigned the number of units set. To set different capacity to a particular Compute resource, specify the CPU units amount to a required Compute resource not a zone. To bill for CPU Units, enable CPU units for a billing plan and set the price per unit.
Each Compute resource core within a zone is given a 1000 CPU Units default value when CPU units are enabled per zone (this is made in the billing plan). The Host can then change that number for each Compute resource to any other number between 1-100,000 to fit its capacity. The faster the Compute resource, the higher the value should be set.
CPU Units show the speed of the CPU - this can be done in any way that the host wants to as it’s just a number that is relative to another number. OnApp will simply process the numbers. For example, if one Compute resource is two times more powerful than another, then the CPU units could be 1000 and 500.
To evaluate Compute resource’s physical performance, you can take the following values:
- CPU Mhz
- Passmark Score (http://www.cpubenchmark.net/)
- BogoMips (http://en.wikipedia.org/wiki/BogoMips)
When creating a VS, you will specify the desired amount of CPU Units that this VS will take out of total CPU Units set for Compute resource.
Example: If you have a Compute zone (Compute resourceZ) with 5 Compute resources attached to it, and you set 1000 CPU Units to Compute resourceZ zone, then each of five Compute resources in this zone will have 1000 CPU Units. In case you would like to increase the capacity of specific Compute resource1 Compute resource to 2000 in this Compute resourceZ zone, set the CPU Units option of this Compute resource1 to 2000. For example, giving Compute resource 1 a score of 1000 and Compute resource 2 the score of 500 is the same as giving Compute resource 1 a score of 2 and Compute resource 2 a score of 1. However, the first case gives you more flexibility in spreading the resources between VSs.
When setting CPU units, the main thing is that the correlation between the CPU Units for each Compute resource should correspond to the correlation of their actual performance. Example of setting CPU units based on CPU speed:
Compute resource CPU Mhz
Compute resource Units
CPU Units are available for Xen and KVM Compute resources only.
- Do not apply CPU Units for KVM Compute resources running on CentOS5, VMware, baremetal servers, and load balancers.
Currently, you cannot change from Cores to Units or Units to Cores in an existing Compute Zone.
- So far only billing calculation can be performed based on CPU units. At this time we do not guarantee the same performance for VSs when migrating to another Compute resource with different capacity.
To set up billing for the instance packages, at first configure the amount of available resources in the package at the Instance Packages > Create Instance Package menu.
Second, add the instance package(s) to the billing plan. There you set the price that will be charged per VS powered on/off for each appropriate instance package.
There are also a number of VS resources that are not set up during instance package creation but are configured automatically:
- CPU Priority - CPU priority is automatically set to 100
- Swap disk size - swap disk size can have the size of 1/2/3 GB. Its size is calculated by multiplying the RAM by two.
- IP address - the first available IP address is selected. One IP address is assigned to the VS created using an instance package for free.
- Port speed - depends on the billing plan limit. If the port speed Max limit in the billing plan is set to unlimited, the port speed in the instance package will also be set to unlimited. If the port speed Max limit in the billing plan is set to a certain value, the port speed in the instance package will be set to that same value.
When you build a VS using an instance package, certain billing plan limits will not apply to that VS:
- Data read/written and input/output requests are not billed for disks of the VS built using an instance package. The VSs disk size will be defined by the disk size indicated in the selected instance package.
- The Limits & Prices for Network Zones will only apply to the VSs that overuse the bandwidth limit set in the selected instance package. A free IP address is assigned to the VS. The VSs port speed, data sent and data received are not billed until the VS overuses the instance package's bandwidth limit. After that, the data the VS sends and receives will be billed according to the Price over free units cost.
For more information, refer to the Billing for Instance Packages section.
In billing plan DRaaS resources are a part of User VS limits. You can set the following additional fees for a VS with DRaaS enabled:
- for disk size per GB per hour
- for RAM per MB per hour
- for CPU core per core per hour
- for CPU per percent per hour or CPU per unit per hour
These prices are additional to regular prices per indicated resources.
Regular price for disk size, set in your billing plan, is 10$ per GB per hour. Additionally you set price for disk size for a VS using DRaaS, as 5$ per GB per hour. So the total price for the VS disk size will be 15$ per GB per hour when DRaaS enabled.