LATEST VERSION: 1.12 - CHANGELOG
RabbitMQ for PCF v1.11

Setting Limits for On-Demand Service Instances

On-demand provisioning is intended to accelerate app development by eliminating the need for development teams to request and wait for operators to create a service instance. However, to control costs, operations teams and administrators must ensure responsible use of resources.

There are several ways to control the provisioning of on-demand service instances by setting various quotas at these levels:

After you set quotas, you can:

Create Global-level Quotas

Each Pivotal Cloud Foundry (PCF) service has a separate service broker. A global quota at the service level sets the maximum number of service instances that can be created by a given service broker. If a service has more than one plan, then the number of service instances for all plans combined cannot exceed the global quota for the service.

The operator sets a global quota for each PCF service independently. For example, if you have Redis for PCF and RabbitMQ for PCF, you must set a separate global service quota for each of them.

When the global quota is reached for a service, no more instances of that service can be created unless the quota is increased, or some instances of that service are deleted.

The global quota is set in the service tile in Ops Manager, shown for an example service below.

Note: This is an example image only. The following screen may look slightly different for your service or release version.

service_level_quotas

Create Plan-level Quotas

A service may offer one or more plans. You can set a separate quota per plan so that instances of that plan cannot exceed the plan quota. For a service with multiple plans, the total number of instances created for all plans combined cannot exceed the global quota for the service.

When the plan quota is reached, no more instances of that plan can be created unless the plan quota is increased or some instances of that plan are deleted.

The plan quota is set in the service tile in Ops Manager, shown for an example service plan below.

Note: This is an example image only. The following screen may look slightly different for your service or release version.

plan_level_quotas

Create and Set Org-level Quotas

An org-level quota applies to all PCF services and sets the maximum number of service instances an organization can create within PCF. For example, if you set your org-level quota to 100, developers can create up to 100 service instances in that org using any combination of PCF services.

When this quota is met, no more service instances of any kind can be created in the org unless the quota is increased or some service instances are deleted.

To create and set an org-level quota, do the following:

  1. Run this command to create a quota for service instances at the org level:

    cf create-quota QUOTA-NAME -m TOTAL-MEMORY -i INSTANCE-MEMORY -r ROUTES -s SERVICE-INSTANCES --allow-paid-service-plans
    

    where these variables are:


    QUOTA-NAME—A name for this quota
    TOTAL-MEMORY—Maximum memory used by all service instances combined
    INSTANCE-MEMORY—Maximum memory used by any single service instance
    ROUTES—Maximum number of routes allowed for all service instances combined
    SERVICE-INSTANCES—Maximum number of service instances allowed for the org


    For example:
    cf create-quota myquota -m 1024mb -i 16gb -r 30 -s 50 --allow-paid-service-plans

  2. Associate the quota you created above with a specific org by running the following command:

    cf set-quota ORG-NAME QUOTA-NAME
    

    For example: cf set-quota dev_org myquota

For more information on managing org-level quotas, see Creating and Modifying Quota Plans.

Create and Set Space-level Quotas

A space-level service quota applies to all PCF services and sets the maximum number of service instances that can be created within a given space in PCF. For example, if you set your space-level quota to 100, developers can create up to 100 service instances in that space using any combination of PCF services.

When this quota is met, no more service instances of any kind can be created in the space unless the quota is updated or some service instances are deleted.

To create and set a space-level quota, do the following:

  1. Run the following command to create the quota:

    cf create-space-quota QUOTA -m TOTAL-MEMORY -i INSTANCE-MEMORY -r ROUTES -s SERVICE-INSTANCES --allow-paid-service-plans
    

    where these variables are:


    QUOTA-NAME—A name for this quota
    TOTAL-MEMORY—Maximum memory used by all service instances combined
    INSTANCE-MEMORY—Maximum memory used by any single service instance
    ROUTES—Maximum number of routes allowed for all service instances combined
    SERVICE-INSTANCES—Maximum number of service instances allowed for the org


    For example: cf create-space-quota myspacequota -m 1024mb -i 16gb -r 30 -s 50 --allow-paid-service-plans

  2. Associate the quota you created above with a specific space by running the following command:

    cf set-space-quota SPACE-NAME QUOTA-NAME
    

    For example:
    cf set-space-quota myspace myspacequota

For more information on managing space-level quotas, see Creating and Modifying Quota Plans.

View Current Org and Space-level Quotas

To view org quotas, run the following command.

cf org ORG-NAME

To view space quotas, run the following command:

cf space SPACE-NAME

For more information on managing org and space-level quotas, see the Creating and Modifying Quota Plans.

Monitor Quota Use and Service Instance Count

Service-level and plan-level quota use, and total number of service instances, are available through the on-demand broker metrics emitted to Loggregator. These metrics are listed below:

Metric Name Description
on-demand-broker/SERVICE-NAME/quota_remaining Quota remaining for all instances across all plans
on-demand-broker/SERVICE-NAME/PLAN-NAME/quota_remaining Quota remaining for a specific plan
on-demand-broker/SERVICE-NAME/total_instances Total instances created across all plans
on-demand-broker/SERVICE-NAME/PLAN-NAME/total_instances Total instances created for a specific plan

Note: Quota metrics are not emitted if no quota has been set.

Calculate Resource Costs for On-Demand Plans

RabbitMQ on-demand plans use dedicated VM, disks, and various other resources from an IaaS, such as AWS. To calculate maximum resource cost for plans individually or combined, you multiply the quota by the cost of VM and Persistent Disk types selected in the plan configuration(s). The specific costs depend on your IaaS.

The image below shows an example of the VM type and persistent disk selected, as well as the quota for this plan.

plan resources

Important: Although operators can limit on-demand instances with plan quotas and a global quota, as described in the above topics, IaaS resource usage still varies based on the number of on-demand instances provisioned.

Calculate Maximum Resource Cost Per On-Demand Plan

To calculate the maximum cost of VMs and persistent disk for each plan, do the following calculation:

plan quota x cost of selected resources

For example, if you selected the options in the above image, you have selected a VM type micro.cpu and a persistent disk type 20 GB, and the plan quota is 15. The VM and persistent disk types have an associated cost for the IaaS you are using. Therefore, to calculate the maximum cost of resources for this plan, multiply the cost of the resources selected by the plan quota:

(15 x cost of micro.cpu VM type) + (15 x cost of 20 GB persistent disk)

Calculate Maximum Resource Cost for All On-Demand Plans

To calculate the maximum cost for all plans combined, add together the maximum costs for each plan. This assumes that the sum of your individual plan quotas is less than the global quota.

Here is an example:

(plan1 quota x plan1 resource cost) + ( plan2 quota x plan2 resource cost) = max cost for all plans

Calculate Actual Resource Cost of all On-Demand Plans

To calculate the current actual resource cost across all your on-demand plans:

  1. Find the number of instances currently provisioned for each active plan by looking at the total_instance metric for that plan.

  2. Multiply the total_instance count for each plan by that plan’s resource costs. Record the costs for each plan.

  3. Add up the costs noted in Step 2 to get your total current resource costs.

For example:

(plan1 total instances x plan1 resource cost) + (plan2 total instances x plan2 resource cost) = current cost for all plans

Create a pull request or raise an issue on the source for this page in GitHub