Optimize Cloud Development Costs with Coder | Part 2/3

As we adopt cloud more and more, cost management and optimization is key to being competitive and profitable. This post will show you how to cut your cloud development costs with Coder, a cloud dev platform. This is part 2 of 3 in our exploration of Cloud Development Platforms with Coder.

We will first talk about cloud costs along with some general strategies to optimize them. Then we’ll cover Coder’s auto-stop, auto-start, dormancy and failure cleanup features and a success story from Skydio who cut their cloud costs by 90% with Coder. Let’s get started!

Video

Video Chapters

  • 0:00 Introduction

  • 00:28 Resource Optimization with Coder

  • 00:52 Exploring Coder’s Cost-Reducing Features

  • 03:01 Success Story: How Skydio Reduced Costs with Coder

  • 04:40 Demo Steps

  • 05:42 Demo Setup

  • 06:11 Using the Coder CLI for Templates

  • 07:04 Pushing the Template to Coder

  • 07:26 Exploring the Template in the UI

  • 08:16 Cost-Saving Settings

  • 10:45 Creating a Workspace

  • 11:18 Workspace Customization

  • 12:00 Building and Running the Workspace

  • 16:05 Reviewing the Template Code

Code

Join the Newsletter and get FREE access to the Source Code

Cloud Costs

Optimizing cloud costs helps you reduce waste, use more, and be more profitable. Cloud environments are flexible and scalable, but costs get out of control without management. Cloud cost optimization lets you allocate resources more efficiently and make informed decisions about your cloud infrastructure.

Here’s why optimizing cloud costs is important:

  • Cost Efficiency: Reduce unnecessary spend and the bottom line.

  • Resource Utilization: Use resources efficiently and don’t waste your investment.

  • Budgeting: Stay within budget and avoid surprise costs and financial shocks.

  • Strategic Planning: Know and optimize your cloud costs to plan and allocate to strategic initiatives.

Identify Current Cloud Costs

Review Pricing and Billing

Reviewing pricing and billing information from your cloud providers is the first step in understanding your current cloud costs. Most cloud providers offer detailed billing reports that break down costs by service, region, and usage type. This information can be used to identify areas to reduce costs and optimize cloud spend.

To review your pricing and billing information:

  1. Access Billing Reports: Log in to your cloud provider’s console and go to the billing section to access the billing reports.

  2. Analyze Usage: Look for patterns in your usage data to see peak usage times, most used services, and underutilized resources.

  3. Identify Cost Drivers and Cost Anomalies: Determine what services and resources are costing the most. These could include compute instances, storage, data transfer, and third-party services.

  4. Compare Pricing Plans: Review different pricing plans and options your cloud provider offers. Consider switching to reserved instances, spot instances, or savings plans to better manage your costs.

Unused and Unattached Resources

Not much has changed since the days of running workloads in the data centers. I remember walking around noticing old servers turned on, sucking power, and using space with a cable attached to a switch, and the switch was off.

Identifying unused and unattached resources is another key step in optimizing cloud costs. These resources include idle instances, unused storage, and unattached volumes that continue to cost without providing value.

Here’s how to identify and manage unused and unattached resources:

  1. Resource Inventory: List all resources in your cloud environment, including instances, storage, and volumes. You must enforce a tagging strategy for all cloud resources.

  2. Idle Instances: Look for instances that are running but not being used. Right-size or terminate them to save costs. This is not simple, as you may find it difficult to know whose instance it is. That’s why tagging resources, as mentioned above, is crucial.

  3. Unattached Volumes: Find and delete unattached storage volumes not attached to running instances.

  4. Storage Usage: Check for unused storage buckets or files and consider deleting or archiving them to save on storage costs.

  5. Automate Cleanup: Use automation tools and scripts to regularly identify and clean up unused and unattached resources. I’ve worked for a few companies that implement bots and give them names like ‘the reaper’ or ‘the exterminator’ to go out and check the tags of resources and take action based on that.

Idle Resources

Now, let’s double-click on idle resources. Identifying idle or unused resources helps you optimize your cloud infrastructure and reduce waste. Idle resources include underutilized compute instances, databases, and other services that are running but not being used. They can be rightsized or terminated to save costs.

To identify idle resources:

  1. Monitor Resource Usage: Use cloud monitoring tools to monitor your resource usage. Look for resources with low usage.

  2. Right-size: Resize underutilized resources to match your workload.

  3. Terminate: Shut down or terminate unused resources that are not needed or have become obsolete.

  4. Set Alerts: Set up alerts to notify you when usage drops below a certain threshold so you can take action.

Cloud Cost Optimization Strategy

A cloud cost optimization strategy helps you align your cloud spend with your business goals. This strategy should include setting budgets, tracking costs, and identifying areas to save costs. A well-defined strategy ensures cloud resources are used efficiently and costs are under control.

Here’s what’s in a cloud cost optimization strategy:

  1. Set Clear Objectives: Define your cost optimization goals and objectives. These could include reducing overall cloud spending, improving resource utilization, or optimizing specific services.

  2. Establish Governance: Set up governance policies and procedures to manage cloud costs. This includes defining roles and responsibilities, setting up approval processes and establishing cost management guidelines.

  3. Budgeting and Forecasting: Set budgets for different departments, teams, or projects. Use forecasting tools to predict future cloud costs and plan accordingly.

  4. Track and Monitor Costs: Use cloud cost management tools to track and monitor your cloud spending in real-time. Review cost reports regularly and take action as needed.

  5. Identify Cost Savings: Continuously look for ways to save costs, such as rightsizing resources and using reserved and spot instances.

Coder Cost-Saving Features

Coder has several features to help you manage resources and save costs.

Right-size Workspaces

As a platform engineer, you can create different workspaces in Coder that meet the needs of your developers. You can offer your developers a choice of cloud computing instances with certain resource limits. You can also use the power of Terraform to spin up instances in a different cloud service provider based on your current cloud bill, where you may have reached a certain budget. This is all under your control as part of the templates you create for your developers.

Auto-Stop

Coder's Auto-Stop Feature

Coder’s auto-stop feature lets you define when workspaces should auto-stop to avoid unnecessary costs. For example, you can set a default auto-stop time of 6 hours. If user activity is detected, the runtime will be extended by 1 hour. You can also enforce stops on specific days or allow users to customize this setting.

Here’s how:

  1. Default Auto-Stop Time: In your workspace template settings, set a default auto-stop time. This will automatically stop workspaces after a period of inactivity.

  2. Activity Detection: This is enabled by default to extend the runtime if user activity is detected. It prevents workspaces from stopping while in use.

  3. Enforce Stop Times: Set specific days and times to stop workspaces. This could be weekends or non-working hours.

  4. User Customization: Allow or deny users to customize the auto-stop settings for their workspaces. This gives flexibility while still having control over resources.

Auto-Start

Coder's Auto-Start Feature

Coder allows or denies users to auto-start workspaces on a schedule. This helps manage resource usage.

Here’s how to use Coder’s auto-start:

  1. Auto-Start Schedule: In your template settings, set a schedule for auto-starting workspaces. This will ensure that workspaces are ready when needed and not delayed.

  2. User Permissions: Allow or deny users the ability to customize the auto-start schedule for their workspaces. This gives flexibility while maintaining control.

  3. Monitor Usage: Monitor the usage of auto-started workspaces to make sure they’re being used efficiently. Adjust the schedule as needed to save resources.

Dormancy

Coder's Dormancy Feature

Coder has a dormancy threshold (e.g. 180 days) to mark workspaces as dormant. Dormant workspaces can be auto-deleted after a set period (e.g. 30 days).

Here’s how to use Coder’s dormancy:

  1. Dormancy Threshold: In your template settings, set a dormancy threshold to mark workspaces as dormant after a period of inactivity.

  2. Auto-Delete: Enable auto-delete for dormant workspaces to delete them after a set period. This will free up resources and save costs.

  3. Review Dormant Workspaces: Regularly review the list of dormant workspaces to make sure valuable workspaces aren’t being deleted by mistake.

  4. Communicate Policies: Tell users about the dormancy policies and auto-delete procedures so they know what to expect.

Failure Cleanup

Coder will stop workspaces that are in a failed state for a set period (e.g. 7 days). This will save resources and keep the environment clean.

Here’s how to use Coder’s failure cleanup:

  1. Cleanup Threshold: In the template settings, set a threshold for how long workspaces can be in a failed state before being stopped.

  2. Auto-Cleanup: Enable auto-cleanup to stop failed workspaces after the specified period. This will save resources.

  3. Monitor Failed Workspaces: Monitor workspaces regularly to catch failures and fix them.

  4. Review Cleanup Logs: Check the auto-cleanup logs to ensure it’s working as expected.

Success Story: How Skydio Saved Costs with Coder

Skydio, a company that makes advanced autonomous drones, had high cloud costs and complex deployment processes. Here’s how they benefited from Coder:

Issues

  • Long Setup: Setting up developer workstations took too long and was resource-intensive.

  • Burst Capabilities: They needed burst capabilities for AI/ML training, which added to their cloud costs.

  • Hardware Inefficiencies: Inefficiencies in managing on-premise hardware and virtual machines (VMs) cost them more.

Skydio used Coder

  1. Flexible Development Environments: Used Coder to create flexible, cloud-based development environments that could be scaled up or down as needed.

  2. Activity Monitoring: Enabled Coder’s activity monitoring to monitor usage and auto-shutdown inactive workspaces to save costs.

  3. Terraform Integration: Used Terraform to define and manage workspaces for consistency and ease of deployment across environments.

Results

  • Cost Savings: Development environment cloud costs were reduced by 90%. Skydio saved a lot by optimizing its cloud infrastructure and using Coder’s cost-saving features.

  • Time: Onboarding time went from a week to under an hour. The streamlined setup and config process was so fast.

  • Adoption: A third of Skydio’s developers voluntarily adopted Coder. It was so easy to use and flexible that developers wanted to use it. This is a dream come true for any platform engineer!

  • Support: Standardized environments made support easier. Having consistent environments reduced the time and effort to troubleshoot and fix issues.

Cloud Cost Optimization at Every Software Development Stage

Optimizing cloud costs at every software development stage helps you reduce waste and better use resources. This means considering cloud costs during design, development, and deployment.

Here’s how to optimize cloud costs across the software development lifecycle:

SDLC Cost Optimization Stages
  1. Design Stage: Consider cloud costs during the design phase. Choose cost-effective architectures and design patterns that use fewer resources.

  2. Development Stage: Optimize the development environments to save costs. This is the phase that Coder plays in.

  3. Deployment Stage: Implement cost-saving measures during deployment. Use reserved instances, spot instances and optimize storage and network usage.

  4. Monitoring and Maintenance: Monitor and analyze cloud costs post-deployment. Fix and optimize as needed.

Shadow IT

Removing shadow IT, which is the use of unauthorized cloud services or resources, can help you save cloud costs and use resources more effectively. Shadow IT can lead to security risks and higher cloud bills.

Here’s how to remove shadow IT:

  1. Policies: Define policies and guidelines for cloud services. Make sure all employees know and follow these policies.

  2. Adopt a Cloud Development Environment (CDE): Instead of allowing developers to create VMs in the cloud for development needs, use a CDE such as Coder to provide flexible and customizable workspaces for your developers while maintaining governance.

  3. Approved Tools: Provide a list of approved cloud services and tools that employees can use. This reduces the temptation to use unauthorized services.

  4. Monitoring: Monitor cloud usage to detect and fix shadow IT. Cloud monitoring tools are used to track resource usage and detect abnormal activity.

Conclusion

Cloud Cost Optimization

To optimize cloud costs, you need to:

  • Assess Current Cloud Costs: Review pricing and billing, find unused and unattached resources, and find idle resources.

  • Develop a Cloud Cost Optimization Strategy: Create a strategy, set budgets, track costs, and find areas to reduce costs.

  • Use a CDE: Instead of creating VMs in the cloud for development, use a CDE like Coder for flexible, customizable workspaces with maintained governance.

  • Optimize Cloud Resources: Right-size computing services, explore autoscaling options and choose the right storage.

  • Leverage Cloud Services: Use reserved instances, savings plans, spot instances, and build a multi-cloud strategy.

  • Implement Cloud Cost Optimization: Optimize costs at every stage of software development, implement cloud-native design, and eliminate shadow IT.

  • Monitor and Analyze Cloud Costs: Use real-time monitoring and analytics, track cost center spend, and find and minimize software license costs.

Continuous Cloud Cost Optimization

Continuous cloud cost optimization is how you stay aligned with your business goals and reduce waste. It is an ongoing process that requires regular monitoring and analysis to find areas for improvement.

Benefits of Using Coder for Cloud Development Cost Optimization

With features like auto-stop, auto-start, dormancy management, and failure cleanup, Coder ensures that resources are used efficiently and unnecessary costs are minimized. The success story of Skydio, which reduced its cloud development costs by 90% using Coder, highlights the potential savings and efficiency gains that Coder can provide.

By adopting a CDE like Coder, you not only enhance governance and control over your cloud resources but also empower your developers with flexible and customizable workspaces. This leads to better resource utilization, lower costs, and a more agile and productive development environment.

Looking Ahead

Stay tuned for the final part of our series, where we will take cloud development optimization to the next level by discussing enhancing security and governance in development environments with Coder. Thank you for reading!

Suggested Reading

Scroll to Top