Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Case Study Saving over $4,000 per month with Au...

Tsukasa Kawamura
August 24, 2024
55

Case Study Saving over $4,000 per month with Aurora Serverless V2

JAWS PANKRATION 2024で発表させていただいたAurora ServerlessV2のコスト削減事例です。
Aurora ServerlessV2の選定ロジックなども解説しています。

Tsukasa Kawamura

August 24, 2024
Tweet

Transcript

  1. © 2024 NTT DATA Corporation © 2024 NTT DATA Corporation

    JAWS PANKRATION 2024 TT-64 Case Study Saving over $4,000 per month with Aurora Serverless V2 Tsukasa Kawamura NTT Data 2024/8/24
  2. © 2024 NTT DATA Corporation 2 Who am I •

    Name ➢ Tsukasa Kawamura • Role / Company ➢ Senior IT Specialist (Cloud) ➢ NTT DATA Japan Corporation • Work Experience ➢ On-premises Infrastructure Design and Architect @ NSD Co., Ltd.(2015~2019) ➢ Cloud Infrastructure Design and Architect @ NSD Co., Ltd.(2019~2020) ➢ Cloud Infrastructure Design, Architects, Consulting and Specialist (Especially for public institutions) @ NTT DATA Japan Corporation (2020~) • Expertise ➢ AWS ➢ Cloud Migration ➢ Cloud Infrastructure ➢ Network Infrastructure • Favorite AWS Services ➢ Route 53 • Hobbies ➢ Cat ➢ Disney • Others ➢ Japan AWS Top Engineer (2022-2024) ➢ Japan AWS All Certifications Engineer (2022-2024)
  3. © 2024 NTT DATA Corporation 3 Today’s Topic • Aurora

    Serverless V2 Cost Reduction Case Study • Aurora Serverless V2 Performance and Scaling • The decision points to consider when adopting Aurora Serverless v2, as well as the features, cost benefits, and disadvantages of Aurora Serverless v2
  4. © 2024 NTT DATA Corporation 4 Agenda 1. What is

    Aurora Serverless V2? 2. Sample Case 3. Cost 4. Performance 5. Selection Policy 6. Summary
  5. © 2024 NTT DATA Corporation 6 What is Aurora Serverless

    V2? • Relational Database with on-demand Auto Scaling configuration • High Availability (Same as Aurora Provisioned) • High Durability (Same as Aurora Provisioned) • High Scalability (Hundreds of thousands of transactions) • High cost-effectiveness • Serverless and Provisioned instances can be used together Amazon Aurora Amazon Aurora Auto Scaling CPU, RAM and Network https://docs.aws.amazon.com/ja_jp/AmazonRD S/latest/AuroraUserGuide/Aurora.Overview.html
  6. © 2024 NTT DATA Corporation 7 Capacity Unit (ACU) Aurora

    Capacity Units (ACU): Aurora Serverless V2 Capacity Units 1ACU: 2GB Memory, corresponding CPU, and networking Minimum ACU: 0.5~ Maximum ACU: ~128 Cost(1ACU): USD 0.20/h (ap-northeast-1) Automatically scales between a specified minimum and maximum capacity https://aws.amazon.com/jp/blogs/news/amazon-aurora-serverless-v2-is- generally-available-instant-scaling-for-demanding-workloads/
  7. © 2024 NTT DATA Corporation 9 Overview (Before Migration) and

    features • WEB AP • Complex search functions • 500,000 users • 1000~500,000 sign in event per days (Random) • 50,000 system linkage events per hours (Random) • All responses within 3 seconds • Running 24 hours 365 days (Exclude maintenance time) • Built on private cloud (On-premises) Private Cloud Production WEB Servers DB Servers Staging AP Servers WEB Servers DB Servers AP Servers Other linkage Systems
  8. © 2024 NTT DATA Corporation 10 Problem • Relatively more

    use on weekdays between 9:00 and 5:00, but also used on holidays and at night • Difficult to make necessary predictions, Must meet performance requirements • High availability required (If the system is down, affects other systems.) • High performance required • Take advantage of the scalability and flexibility of the cloud • EC2 can match demand through scaling, but databases must be provisioned for maximum requirements • Not an environment where continuous monitoring and configuration review is easily possible due to 24-hour operation Sample System Usage A B Requirement of Performance Provisioning according to performance requirements is expensive
  9. © 2024 NTT DATA Corporation 11 Overview (After Migration) •

    Lift to AWS • Using Aurora Serverless V2 • Saving over $4,000 per month(Only Database) • Comply with performance and availability requirements AWS Cloud (Production) Virtual private cloud (VPC) Private subnet Private subnet Private subnet Private subnet AP Servers AP Servers Private subnet Private subnet WEB Servers WEB Servers DB#1(Writer) DB#2(Writer) DB#1(Reader) DB#2(Reader) Availability Zone 1 Availability Zone 2 AWS Cloud (Staging) Same on left Aurora Serverless V2 EC2 AutoScaling In order to use resources efficiently when demand is unpredictable, we wanted to scale not only EC2 but also DB according to demand.
  10. © 2024 NTT DATA Corporation 13 Aurora Provisioned Cost VS

    Aurora Serverless V2 Cost Provisioned Provisioned Provisioned Serverless V2 vCPU Memory CPU:16Core Memory:128 GiB CPU:16Core Memory:128 GiB CPU:16Core Memory:128 GiB 64ACU(128 GiB) Instance Type r5.4xlarge r6g.4xlarge r6g.4xlarge Serverless V2 Pricing Model OnDemand OnDemand Reserved (1yr No Upfront) - Node 4(8) ※MultiAZ 4(8) ※MultiAZ 4(8) ※MultiAZ 4(8) ※MultiAZ Multi-AZ True True True True Cost(ap- northeast-1) 16,352.00 USD/Month 14,635.04 USD/Month 9,617.31 USD/Month 74,752 USD/Month • Aurora Serverless V2 costs about 4.6x more than the r5 instance type. • r6g instance type is the most performance efficient. • As a matter of course, if you choose a reserved instance, you get a significant discount in exchange for flexibility. 0 10000 20000 30000 40000 50000 60000 70000 80000 Cost r5.4xlarge(On-Demand) r6g.4xlarge(On-Demand) r6g.4xlarge(Reserved) Serverless V2 4.6x
  11. © 2024 NTT DATA Corporation 14 Aurora Provisioned Cost VS

    Aurora Serverless V2 Cost • In this case, the cost benefit of adopting ServelessV2 is low unless the average ACU used is below 14. • Cost performance of AuroraServelessV2 on a per unit basis is very bad. Provisioned Serverless V2 vCPU Memory CPU:16Core Memory:128GiB 14ACU(28GiB) Instance Type r5.4xlarge Serverless V2 Pricing Model OnDemand - Node 4(8)※MultiAZ 4(8)※MultiAZ Multi-AZ True True Cost(ap-northeast- 1) 16,352.00 USD/Month 16,352.00 USD/Month Cost Performance(USD/ Memory(1GiB)) 15.96USD/GiB 73USD/GiB 0 10 20 30 40 50 60 70 80 Cost Performance(USD/GiB) r5.4xlarge(On-Demand) Serverless V2
  12. © 2024 NTT DATA Corporation 15 Operating Cost It’s not

    enough to look only at cloud usage fees. The following costs should be considered. • Changes to match demand and peak times • Periodic review of instance types • Testing after changes • Making automatic scaling, etc. Aurora Serverless V2 Cover and Cut above the cost
  13. © 2024 NTT DATA Corporation 16 Our Cost Saving On-premise

    Provisioned Serverless V2 vCPU Memory CPU:16Core Memory:128GiB CPU:16Core Memory:128GiB Min:2ACU(4GiB) Max:64ACU(128 GiB) Instance Type - r5.4xlarge Serverless V2 Pricing Model - OnDemand - Node 4(8)※MultiAZ 4(8)※MultiAZ 4(8)※MultiAZ Multi-AZ - True True Cost(ap- northeast-1) - 16,352.00 USD/Month 4,000~8,000 USD/Month ※Actual value 0 2000 4000 6000 8000 10000 12000 14000 16000 18000 Cost Saving Provisioned Serverless V2 Reduced Over 4,000USD/Month • Initially assumed to use r5.4xlarge instances because it is very close to On-premise instances. • We found that there is a lot of unpredictable load based on the demand for on-premise use, the need to adhere to a defined response time for the maximum request expected, and that the load varies significantly by time. • Our choice to use Aurora allowed us to scale flexibly and saved us about 4,000USD/Month in unnecessary costs.
  14. © 2024 NTT DATA Corporation 17 Why did our case

    allow for massive cost savings? Because it fits the following features • Large-scale changes in usage • Must withstand maximum load at all times • Difficult to make necessary predictions • Rarely loaded at peak capacity • Not an environment where continuous monitoring and configuration review is easily possible due to 24-hour operation • Normal low utilization compared to maximum on requirements Sample System Usage A B Requirement of Performance
  15. © 2024 NTT DATA Corporation 19 Aurora Serverless V2 Performance

    & Scaling • Scales instantly with the load at the following specified values • Minimum ACU • Depending on the case, you may want to specify a memory size that allows the application to run as required with a minimum load • Smaller is more cost-effective, but is a trade-off for performance and scale-up • Maximum ACU • Specify the maximum request value
  16. © 2024 NTT DATA Corporation 20 Aurora Serverless V2 Performance

    & Scaling • ScaleUP • Quickly increase ACU as workload demands begin to reach the writer or reader's current database capacity • Larger instances scale up faster →Set minimum ACU to a value that meets scaling rate requirements • ScaleDown • Scale down incrementally until you reach the capacity you need for your workload →Performance is unlikely to be affected because it does not decrease rapidly https://aws.amazon.com/jp/blogs/news/amazon-aurora-serverless-v2-is- generally-available-instant-scaling-for-demanding-workloads/
  17. © 2024 NTT DATA Corporation 21 Sample Performance Sample Performance

    ACUUtilization CPUUtilization CommitLatency ReadLatency WriteLatency • Scaled quickly to CPU utilization and experienced no performance or scaling issues • Scaling speed and performance must be tested according to requirements and expected scenarios(You should tune the Minimum ACU and Maximum ACU size according to the test results)
  18. © 2024 NTT DATA Corporation 23 Cases suitable for the

    use of Aurora Serverless V2 Low average utilization relative to performance requirements (current situation) Highly difficult to predict load Operational tasks such as scaling are difficult Unacceptable downtime due to scaling Cost reduction through scaling
  19. © 2024 NTT DATA Corporation 24 Selection Flow Is the

    load constant and does it deviate from the performance requirements? Are there potential changes in performance requirements or resource utilization? Aurora Provisioned Instance (OnDemand) Is the scaling speed of ServelessV2 meeting your requirements and is the range of load variability difficult to predict? Aurora Provisioned Instance (Reserved) Aurora Serverless V2 Is the ServerlessV2 simulated price lower than the provisioned instance price? Is there an operational structure in place that can implement scaling and changes to match the load? If so, is the operational cost lower than the cost of using AuroraServerlesV2? YES YES YES No No Yes No No YES No
  20. © 2024 NTT DATA Corporation 26 Summary Cost Performance(Per Unit)

    Ease of adaptation to demand ServelessV2 Provisioned (On-Demand) Provisioned (Reserved) • Aurora Serverless V2 offers flexible scaling, Depending on the case, large-scale cost reductions are also possible • On the other hand, cost savings are case-by-case • It is difficult to say that cost efficiency is necessarily good, so instance type should be selected according to the case • Operating costs should also be taken into account • Cloud usage fees should be simulated. • Scaling performance should always be tested to meet requirements
  21. © 2024 NTT DATA Corporation 27 Conclusion Operational Excellence Cost

    Performance Performance Availability Security Speed • Most choices involve trade-offs • There is no one-size-fits-all solution to the problem • Usage, AWS services, and fees are subject to change, so periodic review is important • Let's choose according to the features!