Track and Manage Usage and Cost

The objective of a continuous cost optimization process is to ensure that the money spent on running services in Oracle Cloud Infrastructure (OCI) yields the most business value for the organization. You can approach this process in different ways but all of them rely on accurate usage and cost data generated by the platform and made available via different channels, such as the UI, CSV files or API calls. Cost Optimization is an iterative process where data and analysis drives actions. One outcome of applying a cost optimization process should be that there are no resources that are sitting idle for prolonged periods of time incurring a cost without delivering any value.

To understand the cost associated with a solution deployed in OCI and the potential options to optimize cost against value,ensure you have designed the solution to allow you a structured way to collect usage and performance metrics from the different services. OCI collects a large amount of metrics but, while designing the solution, you should use the available tools to help provide structure around the collected data as well as set up thresholds to trigger alerts related to increases in spending or underutilized resources.

Evaluate the Different Pricing Models

Enterprise Architect, Cloud Architect

From a business perspective, you need to evaluate which pricing model makes sense: a flexible pay-as-you-go model or a model where you commit to paying a certain amount per month for the duration of the subscription period ("commitment model").

If you have a good understanding of your expected usage, the commitment model could provide a lower cost due to discounted service pricing. But if your usage drops or increases significantly then you could end up paying more when using this model.

Implement a Compartment Structure That Fits Your Organization

Infrastructure Architect, Cloud Architect, Enterprise Architect, Security Architect

Compartments are a fundamental component of Oracle Cloud Infrastructure (OCI) for organizing and isolating your cloud resources. You use them to clearly separate resources for the purposes of measuring usage and billing, access (through the use of policies), and isolation (separating the resources for one project or business unit from another).

As a best practice, set up the tenancy to support the way your business works. This will ensure cost and usage data can be viewed and filtered based on dimensions that make sense to your organization. Typically, this involves using compartments as logical containers to house different OCI services. You can map compartments to organizational units, business units, or even individual service and solution owners ,depending on how your business is run.

Set Up Compartment Quota Policies to Control Resource Usage

Infrastructure Architect, Cloud Architect, DevOps Architect

Quota Policies can be part of an overall governance policy to keep resource usage and cost under control. Polices can be used as safeguards to ensure only designated resource types (for example, compute shapes) are used or individual compartments stay within certain limits.

Implement Cost Tracking Tags for Flexible Cost Tracking

Infrastructure Architect, Cloud Architect

Often, cloud solutions use different services, some of which might reside in different compartments while others reside in a shared compartment, like "Network", governed by different access controls. Some compartments will include resources used by several different solutions and just reporting cost on a compartment level could be inaccurate.
The solution owners still requires visibility into the complete usage and costs of their solution even if resources are located in multiple different compartments.

By attaching cost-tracking tags to the different resources used, you can query cost data by using tags as filters instead of compartments. This allows more flexibility in where resources are placed and how to query cost data but it also mandates a robust Tagging policy. You don't want to be changing tagging namespaces, tag key names often, as this will cause more complexity when searching and aggregating data.

Tagging examples could be attaching tags like: Finance.CostCenter:xyz, Environment.Type:Production,Project.Owner:xyz, Application.Name:xyz to the different resources. This would cause OCI to add the tags to the generated usage and cost data and allow searches based on these tags.

Tagged namespaces should be protected by IAM Policies to ensure only Tag administrators make changes.

Define Budgets

Enterprise Architect, Cloud Architect

A budget can be used to set soft limits on your actual Oracle Cloud Infrastructure (OCI) spending or forecast of spending. When thresholds are reached, the platform can trigger alerts and send emails to designated contacts or raise events that can drive further actions within the OCI platform.

Budgets are set on cost-tracking tags or on compartments (including the root compartment) to track all spending in that cost-tracking tag or for that compartment and its children.

Enable Block Volume Performance Auto Tuning

Infrastructure Architect

Oracle Cloud Infrastructure can automatically tune the performance of your detached volumes to the Lower Cost setting. With this new capability, while your volumes stay in a detached state, you can achieve significant cost savings.

Implement Object Storage, Object Lifecycle Management

Infrastructure Architect

By using Object Lifecycle Management to manage your object storage and archive storage data, you can reduce your storage costs and the amount of time you spend managing data. Object Lifecycle Management lets you automatically:
  • Archive objects to lower cost Archive Storage.
  • Delete all objects in a bucket or objects that match the names filters that you specify.
  • Delete uncommitted or failed multi-part uploads.

Leverage Cost Reports

Enterprise Architect

A cost report is a comma-separated value (CSV) file that can provide a detailed breakdown of resources in Oracle Cloud Infrastructure (OCI) for audit or invoice reconciliation.

The cost report is automatically generated daily, and is stored in an Oracle-owned object storage bucket. It contains one row per each OCI resource (such as instance, object storage bucket, VNIC) per hour, along with consumption information, metadata, and tags. Usage reports generally contain 24 hours of usage data, although occasionally a usage report may contain late-arriving data that is older than 24 hours.

Cost reports are retained for one year.

The file name for each cost report is appended with an automatically incrementing numerical value. The report might contain corrections. Corrections are added as new rows to the report, with the lineItem/iscorrection column set and the referenceNo value of the corrected line populated in the lineItem/backReference column.

Track and Optimize Your Spending by Using Cost Analysis

Enterprise Architect

Cost Analysis provides easy-to-use visualization tools to help you track and optimize your Oracle Cloud Infrastructure spending.
Most new customers in the United States who create new accounts after January 28, 2019 can use cost analysis tools to:
  • Filter costs by dates.
  • Filter costs by tags.
  • Filter costs by compartments.
  • Remove a compartment or tag filter.
  • Forecast cost and consumption.

If you created your account prior to January 28, 2019 or you are from outside the United States, other options for tracking and optimizing spending are available.

Implement a Process to Terminate or STOP Unused Resources

Infrastructure Architect, DevOps Architect

Implement a process to identify and terminate orphaned resources. Certain Oracle Cloud Infrastructure (OCI) compute shapes don't charge in STOP mode. See more at resource billing.
For both VM and Bare Metal instances, billing depends on the shape that you use to create the instance. Be sure that you are familiar with the billing criteria for the compute resource you are using. Also, implement behavior for stopping and terminating that matches your data retention and cost goals for the application workload.

Evaluate What Compute Shape Fits Your Workload

Infrastructure Architect, Cloud Architect

Based on your workload requirements, you might want to use flexible VM.Standard.E3 or VM.Standard.E4 shapes instead of the standard X7 VM shapes with fixed ratios between CPU and Memory.

A flexible shape allows you to customize the number of OCPUs and the amount of memory when launching or resizing your VM. When you create a VM instance using the flexible shape, you select the number of OCPUs and the amount of memory that you need for the workloads that run on the instance. The network bandwidth and number of VNICs scale proportionately with the number of OCPUs. This flexibility enables you to build VMs that match your workload, allowing you to optimize performance and minimize cost.

Become Familiar with Cloud Advisor

Cloud Architect, Security Architect

Cloud Advisor can review and continuously monitor your tenancy and provide recommendations for cost savings and security posture improvements.

Cloud Advisor finds potential inefficiencies in your tenancy and offers guided solutions that explain how to address them. The recommendations help you maximize cost savings and improve the security of your tenancy. The built-in Cloud Guard recommendations help you see and address security vulnerabilities. You can also customize Cloud Advisor by postponing or dismissing recommendations that aren't applicable, allowing you to focus on the recommendations that matter most to you.

The full capabilites and usage of Cloud Advisor are beyond the scope of this Best Practices playbook. For more information on this service, see the "Overview of Oracle Cloud Advisor" referenced in the "Learn More" topic, below.