Tag: spot instances

  • AWS Cost Management in 2024

    AWS Cost Management in 2024

    AWS cost management involves strategies and practices aimed at controlling and optimizing the expenses associated with using Amazon Web Services (AWS). As businesses scale and diversify their use of AWS services, it becomes crucial to manage costs to ensure cloud expenditures remain aligned with business objectives and budgets. Effective cost management in AWS encompasses understanding billing and account structures, monitoring usage and costs in real-time and making informed decisions about resource allocation and deployment.

    At the core of AWS cost management is the ability to visualize and analyze cloud spending. AWS provides detailed billing reports and cost management tools that enable users to track their usage patterns, identify trends and pinpoint areas of inefficiency. Many organizations use third-party tools to get more detailed insights and savings recommendations. This data-driven approach allows organizations to adjust their cloud usage to avoid unnecessary costs, such as by shutting down idle resources or choosing more cost-effective service options.

    Furthermore, cost optimization techniques, such as selecting the appropriate pricing models (e.g., Reserved Instances, Savings Plans), optimizing resource utilization (e.g., scaling resources to match demand) and applying cost allocation tags for granular tracking, are critical components of AWS cost management. These practices help businesses allocate cloud costs accurately across departments or projects, enabling better planning, budgeting and accountability.

    The Importance of Cloud Cost Optimization for DevOps Teams

    Cloud cost optimization is crucial for DevOps teams to ensure efficient resource utilization and cost-effectiveness in cloud environments. As cloud infrastructure becomes more complex and dynamic, DevOps teams face the challenge of balancing performance, scalability and cost. By adopting cost optimization strategies, teams can identify wasteful spending, optimize resource allocation and ensure that cloud investments align with business goals and operational requirements.

    For DevOps teams, cloud cost optimization involves continuous monitoring, analysis and adjustment of cloud resources. This iterative process allows for the fine-tuning of systems to achieve optimal performance without overspending. Techniques such as auto-scaling, choosing the right instance types and employing cost-effective cloud services are part of this optimization. 

    Additionally, implementing budgeting controls and cost alerts helps prevent unexpected expenses, enabling teams to allocate resources more efficiently and respond quickly to changes in demand. Through effective cost optimization, DevOps teams can contribute to the overall financial health of an organization by maximizing the value of cloud investments while supporting rapid development and deployment cycles.

    AWS Cost Management Best Practices in 2024

    Cloud cost management is evolving. Here are some of the best practices that will become more important in 2024 and beyond.

    Adopt Serverless Architectures Where Appropriate

    Serverless architectures, also known as function-as-a-service (FaaS), allow developers to build and run applications without having to manage any servers. This means you only pay for what you use, which can significantly decrease costs when compared to traditional server-based architectures.

    In addition, serverless architectures can scale automatically to meet demand, eliminating the need for manual intervention. This can free up valuable time for your IT team to focus on other important tasks. Furthermore, serverless architectures are highly flexible, allowing for rapid development and deployment of new features and applications. This can significantly reduce time-to-market, which can provide a competitive advantage in today’s fast-paced digital economy.

    Utilize Spot Instances for Flexible Workloads

    Another effective strategy for AWS cost management is to utilize Spot Instances for flexible workloads. Spot Instances are spare AWS EC2 instances that are available at up to 90% off the On-Demand price. This means you can significantly reduce your AWS costs by strategically bidding on and using Spot Instances when demand is low.

    However, it’s important to note that Spot Instances are not suitable for all workloads. They are best suited for flexible, interruptible workloads that can withstand occasional downtime. This includes tasks such as batch processing, data analysis and non-critical background tasks.

    In addition, it’s crucial to have a robust strategy in place to handle Spot Instance interruptions. This can include setting up Auto Scaling Groups, using Spot Fleet or leveraging third-party tools. By effectively managing Spot Instances, you can significantly reduce your AWS costs while maintaining operational efficiency.

    Implement FinOps Principles

    FinOps, or cloud financial management, is a set of principles and best practices designed to help organizations manage and optimize their cloud costs. Implementing FinOps principles is a critical component of AWS cost management in 2024.

    FinOps involves three key principles: Visibility, optimization and governance. Visibility means having a clear understanding of your cloud usage and costs. This can be achieved through comprehensive tagging, detailed cost reporting and regular cost reviews.

    Optimization involves ensuring that you’re using your cloud resources efficiently. This can involve right-sizing your instances, leveraging savings plans and reserved instances and automating your resource management.

    Governance involves setting up policies and procedures to manage your cloud costs. This can include setting up budget alerts, implementing cost approval workflows and regularly auditing your cloud usage and costs.

    Leverage AI for Cost Optimization

    Leveraging artificial intelligence (AI) for cost optimization is a growing trend in AWS cost management. AI can analyze vast amounts of data quickly and accurately, providing valuable insights into your cloud usage and costs.

    For example, AI can identify inefficiencies in your cloud infrastructure, such as underutilized instances, unnecessary data storage, or expensive data transfer. By addressing these inefficiencies, you can significantly reduce your AWS costs.

    In addition, AI can provide predictive analytics, allowing you to forecast future cloud usage and costs. This can help you plan your budget more accurately and make informed decisions about resource allocation.

    Use Sustainable Computing to Reduce Costs

    Sustainable computing, or green computing, is the practice of using computing resources efficiently while minimizing environmental impact. By adopting sustainable computing practices, you can not only reduce your environmental footprint, but also reduce your AWS costs.

    One strategy is to use energy-efficient instances, such as those powered by the AWS Graviton2 processor. These instances deliver superior performance while consuming less power, resulting in lower costs.

    Another strategy is to utilize AWS’s carbon footprint tool, which can help you measure the carbon emissions associated with your AWS usage. By reducing your carbon emissions, you can reduce your environmental impact and potentially qualify for carbon credits, which can offset your AWS costs.

    In conclusion, AWS cost management in 2024 requires a comprehensive approach that includes adopting serverless architectures, utilizing Spot Instances, implementing FinOps principles, leveraging AI and using sustainable computing. By following these best practices, you can effectively manage your AWS costs, optimize your cloud infrastructure and ensure the maximum return on your cloud investments.

  • Complete Guide to AWS Savings Plans

    Complete Guide to AWS Savings Plans

    AWS Savings Plans are a flexible and cost-effective way to save on your Amazon Web Services (AWS) usage. These plans allow you to commit to a specific amount of compute capacity over a one- or three-year term in exchange for a significant discount on your AWS usage. Savings plans can help you reduce your AWS bill by up to 72%, depending on the type of plan and your level of commitment.

    Why Do You Need AWS Savings Plans?

    With the growing reliance on cloud infrastructure in modern IT, it is crucial for organizations to optimize cloud computing costs without compromising on performance or scalability. AWS Savings Plans address this need by providing a flexible and cost-effective solution that allows you to commit to a certain level of usage at a discounted rate.

    With AWS Savings Plans, by committing to a specific amount of compute capacity over a set time period, you can save up to 72% on your AWS usage. This can result in significant cost savings for your organization, freeing up resources to invest in other business-critical initiatives.

    Another benefit of AWS Savings Plans is the flexibility they offer. Unlike Reserved Instances, which require you to specify instance type, operating system and region, Savings Plans are more flexible and can be applied across different instance types, regions and operating systems. This flexibility makes it easier for you to optimize your cloud computing costs while still meeting your business needs.

    Difference Between AWS Savings Plans and Reserved Instances

    AWS Savings Plans and Reserved Instances are both designed to help you save on your AWS usage, but they offer different levels of flexibility and cost savings.

    Reserved Instances require you to commit to a specific instance type, operating system and region for a one- or three-year term in exchange for a discount on your AWS usage. While this can result in significant cost savings, it also limits your ability to optimize your cloud computing costs based on changing business needs.

    AWS Savings Plans offer a more flexible solution that allows you to commit to a certain level of usage across different instance types, regions and operating systems. Additionally, in most scenarios, Savings Plans can provide a higher level of cost savings compared to Reserved Instances.

    Types of AWS Savings Plans

    There are two types of AWS Savings Plans: Compute Savings Plans and EC2 Instance Savings Plans.

    Compute Savings Plans

    Compute Savings Plans are the most flexible type of Savings Plans, providing a significant discount on your AWS usage across any instance type, region or operating system. This flexibility makes it easy for you to optimize your cloud computing costs based on your changing business needs.

    Compute Savings Plans offer a discount of up to 66% compared to on-demand pricing, depending on the level of commitment you make. They can be used across all AWS services that are powered by Amazon EC2 instances, including Amazon EMR, AWS Lambda and Amazon ECS.

    EC2 Instance Savings Plans

    EC2 Instance Savings Plans are a more specific type of Savings Plan, offering a discount on your AWS usage for a specific instance type within a region. These plans provide a higher level of cost savings compared to Compute Savings Plans, with discounts of up to 72%.

    EC2 Instance Savings Plans are ideal for organizations that have a predictable workload and require specific instance types within a region. However, they offer less flexibility than Compute Savings Plans, as they cannot be applied across different instance types, regions or operating systems.

    AWS Savings Plans Pricing Models

    AWS Savings Plans offer three different payment options to suit your organization’s budget and commitment level: All Upfront, Partial Upfront and No Upfront.

    All Upfront

    With the All Upfront payment option, you pay for the entire term of your Savings Plan upfront, resulting in the highest discount compared to on-demand pricing. This option is ideal for organizations that have the budget available to make a significant upfront payment in exchange for maximum cost savings.

    Partial Upfront

    The Partial Upfront payment option allows you to pay a portion of your Savings Plan upfront and the remaining balance on a monthly basis. This option provides a balance between upfront commitment and ongoing flexibility, with a lower discount compared to the All Upfront option.

    No Upfront

    With the No Upfront payment option, you pay for your Savings Plan on a monthly basis, with no upfront payment required. This option provides the lowest discount compared to on-demand pricing but offers the greatest flexibility for organizations with limited budgets or uncertain future usage requirements.

    How to Monitor and Manage AWS Savings Plans

    Monitoring and managing your AWS Savings Plans, as part of your overall cloud operations strategy, is critical to ensuring that you are optimizing your cloud computing costs and maximizing your savings. AWS provides several tools and services to help you monitor and manage your Savings Plans effectively:

    • AWS Cost Explorer: A powerful tool that allows you to analyze your Savings Plans usage and costs, helping you identify opportunities to optimize your cloud computing costs. With Cost Explorer, you can view your Savings Plans coverage, utilization and savings, as well as forecast your future usage and costs.
    • AWS Budgets: This service allows you to set custom cost and usage budgets for your organization, helping you track your Savings Plans usage and ensure that you are staying within your budget.
    • Savings Plans Recommendations: This feature analyzes your past usage and recommends the optimal Savings Plans for your organization. It can help you make informed decisions about which Savings Plans to purchase and how much commitment to make.

    Conclusion

    AWS Savings Plans are an excellent solution for organizations looking to optimize their cloud computing costs and save on their AWS usage. With their flexibility, cost savings and easy monitoring and management options, AWS Savings Plans are a valuable tool for any organization using AWS services.

    To unlock the full potential of AWS Savings Plans, it’s crucial to understand the different types of plans, their pricing models and how to effectively monitor and manage your usage. By doing so, you can maximize your savings and ensure that your organization is getting the most out of its investment in AWS.

  • Why Every DevOps Team Needs a Spot Instance Strategy

    Why Every DevOps Team Needs a Spot Instance Strategy

    Most DevOps teams use the public cloud extensively and focus a lot of energy on reducing cloud costs. According to one estimate, U.S. businesses spent $14.1 billion in 2019 just on wasted, unused cloud resources. Spot instances are one of the most important ways to reduce the cost of public cloud services.

    Spot instances are not a new development. Amazon was the first to announce this pricing option in 2009, turning cloud computing into a market influenced by the dynamics of supply and demand. Microsoft Azure took more than a decade to follow suit, announcing its spot virtual machines offering in May 2020.

    The spot pricing model is simple on the surface but can be complex to implement. Spot instances are how cloud providers sell their unused capacity. When compute instances are not ordered by anyone via the regular, on-demand pricing model, the cloud provider puts them up for auction at very favorable prices, usually around 10% to 20% less than the on-demand cost.

    However, it’s not so simple to get this 80% to 90% discount. When another cloud customer requests the spot instance, the cloud provider sends a notification, and you need to immediately move your workloads before the instance is terminated. This makes it difficult to use spot instances for stateful, database-driven applications, or those that require high availability.

    This is not the only challenge. The market price fluctuates and is much more volatile than on-demand pricing. This means the level of discount that can be achieved over time is relatively unpredictable.

    However, there are at least three ways savvy DevOps teams can make great use of spot instances:

    1. Automation—DevOps teams are proficient with a range of automation tools, including configuration management, infrastructure as code (IaC) and cloud provider auto-scaling tools. These can be used to manage workloads in clusters and automatically fail over when a spot instance terminates.
    2. Dev/test environments—DevOps teams are responsible for setting up development and testing environments, which are extremely suitable for spot instances because they can usually tolerate brief interruptions, and, in many cases, are not stateful.
    3. CI/CD jobs—running jobs on Jenkins, GitLab and similar tools can be easy to scale on spot instances. These jobs are stateless, and if an instance drops, it’s easy to rerun the job on another.

    AWS Spot Instances

    AWS Spot Instances let you buy unused Amazon EC2 computing power at a significantly discounted price. You can specify a price, and when a spot instance is offered at that price, it is launched with the Amazon Machine Image (AMI) of your choice.

    How Spot Instances Work on AWS

    Spot instances are priced at a variable spot price, which is adjusted according to supply and demand conditions. To see current rates, use the AWS Spot Instance Advisor.

    You create a spot instance request, specifying what instance types you are interested in, and the availability zones (AZ) in which they should run. If capacity is available, and their current price is less than your maximum bid, instances are launched.

    Spot instances continue running until:

    • Capacity is no longer available (because the instances were requested by on-demand customers).
    • The price has risen over your maximum bid.
    • You request to terminate the instance, or it is automatically terminated by auto-scaling.

    You can also order spot instances with a predefined duration—you then pay a static hourly rate for that entire duration (even if market price changes in the interim).

    Automation Options

    You can automatically scale instances on Amazon EC2, including both on-demand instances and spot instances in a single auto-scaling group. If spot instances are not available when scaling up, the group can use regular on-demand instances.

    Amazon also supports mixing in reserved instances and savings plans (additional ways to save on on-demand instances by committing to a certain period of time or total capacity). So you can combine multiple saving methods in the same auto-scaling group.

    You can improve availability by deploying applications across multiple instance types running in multiple AZs. By allowing multiple instance types, you tap into multiple pools and increase the chances of obtaining a spot instance when you need it.

    Azure Spot Instances (Spot VMs)

    Azure offers Spot VMs that give you access to unused compute capacity. You can request a single spot VM, or launch multiple spot VMs using an Azure VM Scale Set (VMSS). Spot VMs replaced the previous Low Priority VMs feature, which let you purchase VMs that were in low demand on Azure for a reduced price.

    The spot price of VMs on Azure depends on the total capacity available for that specific instance size and SKU (instance type) in the Azure region. Azure commits to changing pricing slowly—avoiding sudden spikes—to maintain pricing stability and make it easier to manage budgets.

    Like on Amazon, discounts fluctuate significantly, and spot VMs can be up to 90% cheaper than the base price of the same VM.

    How Spot VMs Work on Azure

    The Azure Portal provides access to Azure spot VMs. When you create a spot VM, you can see the current price for the selected region, image and VM size. For consistency, prices are always in U.S. dollars, even if you use a different base currency for billing.

    There are two options for eviction of spot VMs—you can choose the condition on which spot VMs will be evicted:

    • Maximum price eviction—You set a maximum bidding price, and when the spot VM rises over that price, it is evicted.
    • Capacity eviction—You always pay the current price of the VM (without setting a maximum price), and when Azure does not have sufficient capacity of the requested VM type, your VM is evicted.

    When a VM is evicted, Azure applies an eviction policy called Stop / Deallocate. This means the instance is paused, but attached disks remain, and you are still charged for them. When the price goes down or capacity becomes available, the instance is restarted and continues working on the same disk data.

    Automation Options

    Azure provides virtual machine scale sets (VMSS), which can automatically increase or decrease the number of VMs running your application. You can create a scale set that includes spot VMs, and as your application scales, more spot VMs will be added as they become available. Spot scale sets operate in a single fault domain and do not guarantee high availability. Unlike AWS, Azure currently does not allow you to mix on-demand VMs and spot VMs.

    Both Amazon and Azure provide robust capabilities for cost savings using spot instances. Azure’s offering is newer and provides less-advanced bidding and auto-scaling capabilities, but these are expected to be added as the service matures.

    Whether DevOps teams choose to run in AWS, Azure, or both, they literally cannot afford to ignore spot instances, especially for low-criticality workloads like dev/test and CI/CD job execution.

  • Spot Instances on Black Friday: A Case Study

    Spot Instances on Black Friday: A Case Study

    Businesses made the right choice using spot instances for Black Friday

    Black Friday is the unofficial kickoff to the holiday shopping season, when retailers announce exciting deals to attract as many customers as they can into their stores. With online shopping surging in recent years, e-commerce and AdTech businesses are also participating in Black Friday to increase their online presence and revenues. Today, millions of customers have the choice of shopping online or in brick-and-mortar stores. While these stores have their challenges managing massive amounts of shoppers, e-commerce and AdTech businesses are dealing with their own set of challenges when it comes to handling shopper traffic.

    Source: Business Insider

    During peak shopping days such as Black Friday, businesses use significantly more capacity to process online shopper requests while constantly trying to provide them optimal performance. In theory, as more companies utilize resources from a cloud provider, they may experience a capacity shortage when trying to scale. When a busy online shopping day finally approaches, this theory can become a reality as online retailers scale to meet their shoppers’ demands and cloud providers struggle to accommodate capacity. However, what many cloud users may not know is that about 50 percent of the major cloud vendors’ infrastructure is mostly idle.

    To be clear, this is not because AWS, Microsoft or Google are struggling to sell their capacity; it’s because they have to be ready for rapid increases in usage—just like the one businesses experience during Black Friday.

    The fear of insufficient capacity also has made users apprehensive to use cloud providers’ excess capacity such as spot instances to run their workloads, since many customers are using more cloud resources and are eating all of the cloud inventory. Businesses simply do not want to take a chance trying to compete for excess capacity and opt for something more predictable, such as on-demand instances. The fact that cloud providers are capable of handling the most aggressive computing demands has created a situation in which businesses that chose to make intelligent use of excess capacity during Black Friday saw great returns on their investments.

    Events such as Black Friday, national elections and the Super Bowl are pretty extreme stress tests for any consumer-facing business. We thought it would interesting to go through the data and see how the AWS spot market behaved during Black Friday, and see what we can learn from it. In this blog post, I will go over the spot market statistics and lessons learned from 2018’s Black Friday.

    Spot Markets and Statistics

    Spot markets are defined as the supply and demand for a specific instance type at a specific spot price in an availability zone. Spotinst Elastigroup ranks spot markets for availability and costs from current and historical data in a process called Spot Market Scoring. Spot Market Scoring enables us to predict an instance interruption in a market approximately 15 minutes before it happens (sometimes even more than an hour). This advance notification on upcoming interruptions is what triggers the spot instance replacement and ensures the continuous availability of compute workloads. Let’s see how the spot markets behaved before and after Black Friday.

    Now that you have a better understanding of the spot market, let’s delve into the statistics from Black Friday. In the image below, we can see the number of spot interruptions for each Friday three months prior to Black Friday in the us-west-1 and us-east-1 region. The us-east-1 region had significantly more spot interruptions during this period.

    The graph below shows the number of spot interruptions that occurred a week before and after Black Friday in us-east-1 and us-west-1 across all instance types. We can see that us-west-1 was more reliable for spot instances than us-east-1. Also, us-east-1 continued to experience more outages the week after Black Friday.

    We then took a look at popular instance types and sizes used before, on and after Black Friday to see how many interruptions there were. In the image below, we can see that c4.4xlarge had the highest number of interruptions and incrementally improved after.

    The section below shows metrics for Back Friday in comparison across different availability zones in us-east-1 and us-west-2:

    1. Total Spot Interruptions this Black Friday in the US: 462
    2. Breaking down the Interruptions by Availability Zones, some had more Spot interruptions than others
    Availability Zone us-east-1 us-west-2
    AZ 1 29 1
    AZ 2 3 7
    AZ 3 24 3
    1. Average Spot Uptime: 2675 Minutes (1.8 days)

    What Spot Interruptions and Autoscaling Events Look like

    Let’s examine what a spot market interruption looks like and how Elastigroup handles the situation. In the data below, you can see an actual event log from one of our customers.We can see that early on Black Friday, the day started with Elastigroup automatically replacing terminated or soon-to-be-terminated instances. A little later, as shoppers began scavenging the internet for deals, we see that the instances were automatically scaled up to meet demand. Elastigroup scaled down the instances the following day because demand was not as high as on Black Friday. With this type of autoscaling automation in Elastigroup, administrators can spend more time worrying about application development and other tasks.

    Takeaways

    1. DevOps Automation is Key – Elastigroup uses predictive algorithms to identify and drain instances that are about to be terminated. Prior to termination, Elastigroup will launch a new instance and replace it seamlessly. Elastigroup will also make sure to distribute your instances across different types to optimize costs and longevity.
    2. Spot Instance Availability – Having a stable uptime is crucial for peak days such as Black Friday. With millions of shoppers visiting e-commerce sites, an outage can result in revenue loss. On Black Friday, the small number of spot instances that experienced interruptions had an average uptime of 1.8 days. With that uptime, organizations can rely on spot instances managed by Elastigroup to reduce costs while not sacrificing service availability during peak times.
    3. Spot Market – Spots allow businesses to make better decisions without sacrificing costs and availability. Elastigroup reliably leverages the spot market to optimize your underlying infrastructure for cost, without compromising availability. Per the statistics above, we can see that some availability zones had more spot terminations than others. AZ 1 in us-east-1 had the highest number of spot interruptions.

    — Amiram Shachar