Date
Category
Blog
Author

Navigating Cloud Cost Efficiency: Unveiling the Power of Service Refactoring

Image to illustrate cloud compute costs.

In the world of cloud computing, cost optimization stands as a paramount concern for businesses as they harness services from cloud giants such as AWS, Azure.

1. Cloud Cost Reduction Strategies

Before jumping into the specifics, it’s important to grasp the broader strategies available for cost reduction in the cloud. These encompass optimizing instance types, leveraging reserved instances, exploring the potential of serverless architectures, and maintaining vigilance through continuous monitoring and resource allocation adjustments. Public cloud providers extensively document these strategies, offering comprehensive insights for achieving minimal costs aligned with workload requirements.

2. Case Study: Unpacking the Portal Project’s Cost Dynamics

Let’s scrutinize a real-world project dubbed “Portal,” functioning as the internal corporate site and currently hosted on AWS. 

Despite implementing standard cost reduction strategies, hosting 22 services on two Kubernetes-managed virtual machines (VMs) incurs a monthly cost of $250 post-optimization. Despite the low CPU usage (9%), these VMs consistently grapple with memory pressure surpassing 70%. The memory pressure leads us to deploy bigger instances even though we have low CPU usage. Bigger instances are more expensive.

3. Assessing Memory Consumption

While high memory consumption among the 22 services might be intrinsic to their workload and functions, a more in-depth analysis is needed. 

Examining individual service memory consumption revealed three outliers constituting 33% of the total memory consumption:

Graphic showing memory usage by Internal-requests-service (16.3%)
Redmine (9%)
Resume-api (7.4%)
  1. Internal-requests-service (16.3%)
  2. Redmine (9%)
  3. Resume-api (7.4%)

This substantial divergence in memory usage prompts a closer examination of these services, potentially warranting a refactoring and optimization initiative. 

Additionally, it’s essential to note that this 33% cost impact is per environment, encompassing development, staging, and production environments.

4. Strategic Implications

The strategy of service refactoring gains paramount importance, especially for companies transitioning from on-premise to the cloud. 

Often, the initial migration adopts the ‘lift and shift’ strategy, where services are migrated as is. In an on-premise environment, the intricacies of service architecture might be overlooked. However, in the cloud, meticulous attention is warranted, as every resource utilization is billable. 

Poorly optimized services can strain the company’s budget.

5. The Quest for Cloud Cost Reduction

Assessing and refactoring services emerges as a game-changing tactic in the pursuit of cost reduction. 

By honing in on high-impact services and optimizing their memory consumption, businesses stand to gain not only significant cost savings but also enhanced system performance. 

The case study of the Portal project serves as a testament to the tangible benefits arising from a strategic and targeted approach to service rewriting.

6. Fastdev’s Proactive approach to Cloud Cost Management

In conclusion, the dynamism of cloud computing necessitates a proactive approach to cost management. 

Service refactoring emerges as a linchpin strategy, especially in the transition from on-premise to the cloud. The Portal project exemplifies how careful focus on service architecture and memory optimization can produce tangible results in both cost savings and operational efficiency.

At Fastdev we encourage you to assess your environment as a call to action. This task doesn’t demand a significant time commitment but may expose noteworthy issues. Addressing these concerns could lead to substantial cost reductions with far-reaching benefits.

In our next article on reducing cloud costs,

We’ll explore the technical intricacies of service refactoring. 

We’ll be looking into:

  1. Challenges you might encounter
  2. Where to initiate your investigation
  3. Recommended approaches
  4. Strategies to avoid

— Stay tuned for a comprehensive exploration of the finer points in service refactoring.

Author/ Dmitry Ivanov / .NET Software developer

The latest news

See all
Up