Managing Cost

[Cost Optimisation Pillar from AWS offers a fantastic introduction to managing costs on AWS] 

Cost Optimisation


While evaluating costs for your solution, use this checklist

  • Managed Service vs Self hosted solution: By selecting the appropriate building blocks and managed services, you can reduce or remove much of your administrative and operational overhead, lower operating costs and free you to work on applications and business activities.
  • Licensing Costs
    • User based vs Bullk
  • Pay per usage vs Standard costs. 
  • Networking costs
    • Data Transfer (within and across DC)
    • Elastic IP
    • API calls
    • HTTP vs HTTPS
  • Storage costs
    • How much data are you going to store or generate?
    • What is the retention period?
    • Backup and Restore
      • Hot / Cold data structuring.
    • Replication
    • IOPS
    • Caching
    • Snapshotting
  • Choose the right Instance Type
    • Memory,
    • IOPS,
    • CPU,
    • Disk instances are available to choose from.
  • Capacity Planning: Right capacity planning avoids wasting costs.
  • Choose right instance type - Spot, OnDemand Reserved, EC2 Fleet

Tracking Costs

Cost optimisation is an ongoing effort. Tracking costs helps tune the cost model, figure out optimisation areas, understand total cost of ownership and recommend pricing options for Business


  • Choose right instance type - Spot, OnDemand Reserved, EC2 Fleet
  • Consistently tag all the resources used.
  • Setup alerts to detect daily and monthly breach and act with alacrity
  • Use Costs Explorer to understand the costs split across services, instance types, business tags.
  • Tracking monthly costing trend month helps to project future costs, understand basic changes in operating structure
  • Include stakeholders and plan cost reduction by working on cost

Further Cost Optimisation


After your solution is deployed and tracked, consider further optimisations. 

  • Prepare Cost model for the Service 
    • Expected use in terms of CPU / Memory / Disk
    • Track Expected vs Actual and modify cost model based on observation - understand how cost varies
    • Cost model should help identify what parameter varies the cost. e.g,
      • Cost / No: of users, 
      • Cost / No: of documents,
      • Cost / 1GB of storage iv.  Cost / 1M API calls
  • Tools
    • Tools like Botmetrics can recommend right instance type based on usage
    • Some providers bid for instances and pass on the savings as well
  • Automation
    • AWS instance scheduling - shutdown and bring up instances automatically based on time
    • Dev / QA clusters can be set up and torn down on demand. Reduce the need for long running clusters
  • Architecture
    • Use Autoscaling design where possible
    • Serverless - Lambdas
    • Docker / K8S - Goal: Max resource utilisation,  Datacenter as OS
    • Other architectural changes 

Finally,


all the areas should be working together in a continuous cycle. What items you pick in each stage depends on your particular situation. Feel free to move items to different stages - the goal is to get into a groove on cost cycle.


Cost Awareness -> Cost Optimisation -> Deploy -> Track Cost -> Further Cost Optimisation -> More Cost Awareness 


This cycle deepens when done consistently over a period of time. You will gain deeper understanding of the cost implications and a systematic way of handling costs

No comments:

Post a Comment