Cost Optimization

What is Cost optimization?

Cloud optimization is the process of analyzing and configuring the allocation of cloud resources that power applications, infrastructures, and workloads to maximize performance and minimize waste due to over-provisioning.

The rise of DevOps has ushered in an era of high-velocity delivery and daily releases of new code. But despite the ever-growing complexity of cloud applications, the post-delivery portion of the Continuous Integration & Continuous Deployment pipeline has been woefully neglected. 

Most enterprises leave their apps running hot and only attempt to tune their apps for performance when they’ve failed to meet SLO and SLA, or as a response to downtime. Most application parameters are left untouched altogether, and enterprises massively overprovision in order to buy peace of mind. 

This oversight is costing large enterprises tens of millions of dollars, and hampering their performance. The goal of cloud optimization is to reverse this trend. Cloud optimization frameworks seek to achieve absolute cost efficiency and optimal performance (while adhering to compliance policies).

cloud optimization

How can you reduce cost billing on cloud?

Cost Billing Reduction on Cloud

Before you start saving, it is important to understand cost composition. In each cloud, there are cost management tools that show different segmentation of costs by service type. These tools can automatically detect available servers and recommend that they are reduced or turned off.

Part 1: Server Costs

Usually, servers are the largest component of the overall cost, so we will start with a number of server cost-saving strategies, then look at how you can lower your storage and network expenses. Finally, we’ll review some business options to obtain significant discounts on cloud spending.

Turn Off Servers

Estimated discount — 15% of total server cost

  • Turn off servers that are not being used.
  • Sizing — Adjusts the size of the server to the amount and usage load.
  • Restrict user permissions to create new servers.

Reserved Instances

Estimated discount — 50% of the cost of long-term servers

Reserved Instances (RI) can significantly reduce server costs, provided you commit to a long term contract (1–3 years).

This program is not suitable for temporary servers that we may not need in the future. Usually, a commitment for a year will give a 40% discount, while a commitment for three years will provide a 60% discount. If you still want to stop using a server you have committed to, there are several ways to get out of the RI commitment:

Spot Instances

Estimated discount — 70% of server costs that are not “mission critical”

Spot servers or low priority servers are 70–90% cheaper than regular servers of the same power! Furthermore, today the discount is fixed (and not by the auction process as practiced in the past).

The catch is that these servers are low-priority so you run the risk that they will suddenly close without notice.

Fortunately, there are several ways to deal with this unfortunate state of affairs:

  • Running stateless services that are not critical; if they close, you can always turn them on again (the disc is not deleted).
  • Working with a queue; if a server closes, the task will remain in a queue and wait for another server.
  • Use auto scaling rules to automatically handle a particular instance count if a spot server is closed.
  • A company called Spotinst helps reduce costs by effectively using Spot. They are able to identify spot servers that are about to close and replace them with other spot servers with virtually no downtime. From an inquiry I made, it seems that their Azure support is still incomplete (Azure K8s service is not fully supported), but AWS is better supported.

Part 2: Storage And Network

Storage

Estimated discount — 20% of storage costs

Here are the top five cloud storage categories ordered from low cost to expensive (from slowest to fastest):

  • Archive storage
  • Object storage
  • File storage — Network libraries that can be mapped to multiple servers
  • Block storage
  • Database storage

Within each storage category, there are several price levels depending on speed and redundancy.

Raw data can be stored in a cheap storage category, but metadata, used for queries, is best kept in an expensive storage category.

Archive storage is the cheapest form of storage, but is not practical for ongoing work due to slow retrieval times. Object storage is the next cheapest storage category. Therefore, this is the preferred storage choice for the majority of the data.

You should set up a “Storage Lifecycle” policy that allows you to set rules for automatically moving old files to cheaper storage categories. (Available in AWS and found in preview in Azure).

Network

Estimated discount — 20% of the cost of network traffic.

The network traffic consists of internal traffic (within your network) and external traffic between the server and the customers.

For internal traffic I recommend:

  • allowing processes to operate within the same geographical area if possible.
  • using only internal addresses.

For external traffic I use Cloudflare, which has the following advantages:

  • DDOS protection
  • CDN — Files are downloaded from Cloudflare servers closest to the client location.
  • Uses “Brotli” compression that is better than gzip.
  • Cloudflare workers — run request logic at a Cloudflare endpoint before the request reaches my network.

Part 3: Business Discounts

Cloud providers and their partners have many programs that can offer significant discounts. Large customers can also bargain directly with cloud providers for discounts.

Even if the whole system is on one cloud, sometimes, in specific areas it is useful to use competing external services like CDN, DNS or even another cloud in order to lower costs.

Cloud Partners

Estimated discount — 5–10% off the total cost + consultation

There is no substitute for consultation from an experienced cloud architect. All the major cloud providers have partners that provide consulting services. Working with them can provide a number of benefits.

For example:

  • Discounts on the total cost of the cloud
  • Support for malfunctions
  • Architectural consulting
  • Tools for cost management
  • Flexible payment terms

Each of the major cloud providers has more information on this:

Startup Programs

Estimated discount — credit that can reach tens of thousands of dollars or more

All the cloud companies have plans that can benefit start-ups.

The benefits can include:

  • Credit for cloud usage
  • Consulting services
  • Business promotion/accelerator

Each of the major cloud providers has more information on this:

Free Tier Programs

Estimated discount — first year free for small servers.

All cloud providers have free tier plans. These programs allow free use of the lowest cost services for a year or for a fixed number of uses. There is usually no limit to the number of free tier accounts that can be created.

For further details. Contact us