Metering, Throttling and Billing in StratosLive

Archived Content
This article is provided for historical perspective only, and may not reflect current conditions. Please refer to relevant product page for more up-to-date product information and resources.
  • By Amila Maharachchi
  • 21 Aug, 2011

Introduction

StratosLive is a public cloud deployment. There needs to be a way of measuring how tenants consume StratosLive resources. It is necessary to measure them to control or facilitate the tenants consuming resources. StratosLive encourages tenants to make full use of it's resources. But there needs to be a control mechanism too. Metering, Throttling and Billing components are responsible for measuring resource usage, controlling access to resources and charging the tenants in StratosLive.

Applies To

StratosLive 1.5.1

Content

What is Metering, Throttling and Billing?

Metering is the base for Billing and Throttling. It measures bandwidth and storage consumed by tenants. Throttling runs its throttling rules against the metered data and takes decisions on access controlling to resources. These resources are, webapps, services, registry storage and registry items. Billing, if enabled (which is enabled in StratosLive), charges customers based on the metered data in a monthly basis. Billing considers not only the metered data, but also the usage plan which the tenant is subscribed and the pricing strategy.

Metering

What are being metered?

In StratosLive following are being metered tenant-wise.

  • Webapp bandwidth – When a request is coming to a webapp hosted by a tenant and a response is sent, the amount of bandwidth consumed is metered.
  • Service bandwidth – When a service hosted by a tenant is invoked and a response is received, the amount of bandwidth consumed is metered.
  • Registry bandwidth – When registry resources are accessed (get/put), the amount of bandwidth consumed is metered.
  • Registry storage – When artifacts are added to the registry, the amount of consumed registry storage is metered.

How they are being metered?

Webapp and service bandwidths are measured via Tomcat valves. When the request is going through the valve, bandwidth is measured. Registry bandwidth and registry storage is measured when artifacts put/get into/from the registry.
StratosLive services (i.e. Enterprise Service Bus, Application Server) measures the above data and sends them to the Business Activity Monitor to be stored. These metered data are then summarized periodically making them available for billing and throttling components.

What data is available for tenants?

Tenants can view their monthly usage report in StratosLive Manager under the following menu.
Home → Billing & Metering → Usage Report
Shown below is a screen shot of a usage report.

Sample Usage Report

Throttling

Throttling component is scheduled to run throttling rules periodically and update permission of tenants on accessing/consuming various resources and stores them in the registry. There are throttling agents in each and every service. When a tenant is trying to access a webapp/service/registry item, throttling agent looks for the permission for the relevant action and decides whether to allow or discard the request. One great advantage of the throttling in StratosLive is throttling rules can be updated on the fly. StratosLive Manager provides this facility only to the super-tenant (i.e. the administrator of StratosLive). This means, if you have a private cloud setup, you have total control over throttling. Once the rules are updated via the StratosLive Manager UI, next run of the rules will be using the updated rules.

Billing

Billing (bill generation) is done on a monthly basis. Bill generation is scheduled on the last day of each month. This date can be configured as you wish. When the bill generation is completed, customers (tenants) are informed via email. They can view their invoice in StratosLive Manager Home → Billing & Metering → Past Invoices. Customers can also view their interim invoice too. Interim invoice is the invoice for the time period from last invoice to this moment. This is generated on demand and can be viewed in StratosLive Manager Home → Billing & Metering → Interim Invoice.
Shown below is a sample invoice.

Sample Invoice

Why billing is important?

StratosLive is a public cloud deployment. Users can create account and use it to achieve their industrial objectives. Users can try StratosLive for free and if they are satisfied, they can even use it for production purposes. Billing is important when we need to charge the users for consuming StratosLive resources. It should be obvious that it is not feasible to let users use this totally free due to cost we come across in hosting StratosLive. With the current pricing strategy, users are allowed to select the usage plan according to their needs and billing will make sure they will be charged according to the usage plan and resources consumed.

Payment procedure

StratosLive users can pay their invoices via Paypal securely. Paypal link can be found with the invoice. When you click the Paypal link, you will be redirected to the Paypal site for authentication. Once the authentication is done, you will be provided with the details of the transaction about to be carried out. You can confirm or cancel the transaction. After a successful transaction, you will be provided with a receipt from WSO2 which you can keep as proof of your payment. You will also get notified via email.
If you go and view the interim invoice after a successful payment, your payment details will appear in it. Shown below is a sample receipt which is received after a successful transaction.

Sample Receipt

Role of metering, throttling and billing in a private cloud scenario?

In StratosLive, WSO2 hosts the service, it meters tenants' resource consumption and charges them accordingly. Stratos can be deployed as a private cloud deployment too. Imagine your organization has several departments. If you decide to setup Stratos as a private cloud, you can create tenants for each department. For the employees in those department, you can create users in the respective tenants. Now, you may throw the question “Why should I bill my own departments?”. Well, if your organization is a pretty big one and you manage your expenses independently, then you might find billing applicable. If not, yet you can let billing to run. Yes, the billing component is configurable such that you can configure the charges too. Once the bill is generated, it will help you to see whether your departments have consumed excess amount of resources.
With the usage report available in the StratosLive Manager, you will be able to get a full understanding of how your departments are consuming the cloud resources. Most importantly, throttling will help you to control how the departments are allowed access to the resources.

Where does Metering, Throttling and Billing takes place in StratosLive?

StratosLive user base is growing day-by-day. Therefore, metering, throttling and billing operations can be heavy. StratosLive deployment architecture makes sure that this does not affect the smooth functioning of any other services. It is done by keeping a dedicated instance for these three tasks. This instance is called the Summarizer.

Future improvements

It is not yet possible to measure the database consumption by users. Hence it is not possible to throttle or charge the user for consuming databases in StratosLive. One of the major targets in the near future will be to achieve this.
Currently, StratosLive only accepts payments via Paypal. It will be made possible to plug any payment mechanism in the future. This will benefit the private cloud deployments a lot and this will also improve the user experience when it comes to paying the invoices.

About Author

  • Amila Maharachchi
  • Associate Director / Architect
  • WSO2